Skip to content

Commit f6a071e

Browse files
committed
dont listen to event on legacy to not break bypass perms
1 parent 3ca8232 commit f6a071e

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

  • AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/chunklimits

AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/chunklimits/BlockLimit.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.bukkit.event.HandlerList;
1919
import org.bukkit.event.Listener;
2020
import org.bukkit.event.block.Action;
21-
import org.bukkit.event.block.BlockCanBuildEvent;
2221
import org.bukkit.event.block.BlockPlaceEvent;
2322
import org.bukkit.event.player.PlayerInteractEvent;
2423
import org.jetbrains.annotations.NotNull;
@@ -194,33 +193,6 @@ private void sendPlayerNotification(Player player, Material block, int existing,
194193
.replace("%limit%", Integer.toString(limit)));
195194
}
196195

197-
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
198-
private void onBlockCanBuild(BlockCanBuildEvent event) {
199-
if (!blockLimits.containsKey(event.getMaterial())) {
200-
return;
201-
}
202-
203-
int materialCount = getMaterialCountForChunk(event.getBlock().getType(), event.getBlock().getChunk());
204-
int limit = blockLimits.get(event.getBlock().getType());
205-
206-
if (materialCount <= limit) {
207-
logger().debug("Allowing UNKNOWN to place {} at location {} => count={} limit={}",
208-
event.getMaterial(),
209-
LocationUtil.toString(event.getBlock().getLocation()),
210-
materialCount,
211-
limit);
212-
return;
213-
}
214-
215-
event.setBuildable(false);
216-
217-
logger().info("Preventing UNKNOWN from placing {} at location {} => count={} limit={}",
218-
event.getBlock().getType(),
219-
LocationUtil.toString(event.getBlock().getLocation()),
220-
materialCount,
221-
limit);
222-
}
223-
224196
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
225197
private void onBlockPlace(BlockPlaceEvent event) {
226198
if (!blockLimits.containsKey(event.getBlock().getType())) {

0 commit comments

Comments
 (0)