From d6b2b41c891ea2d4c588a8a18154c1383af218bb Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 28 Jan 2022 20:28:44 +0000 Subject: [PATCH] Ground level//bedrock is at min gen height - Add comment on == rather than <= being used - It's because it's only checking for the bedrock layer being broken if that's disabled --- .../com/plotsquared/bukkit/listener/BlockEventListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java index db6f24e75..1e71e642c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java @@ -354,7 +354,8 @@ public class BlockEventListener implements Listener { Plot plot = area.getPlot(location); if (plot != null) { BukkitPlayer plotPlayer = BukkitUtil.adapt(player); - if (event.getBlock().getY() == area.getMinBuildHeight()) { + // == rather than <= as we only care about the "ground level" not being destroyed + if (event.getBlock().getY() == area.getMinGenHeight()) { if (!Permissions .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { plotPlayer.sendMessage( @@ -649,7 +650,8 @@ public class BlockEventListener implements Listener { event.getBlock().breakNaturally(); } } - if (location.getY() == area.getMinBuildHeight()) { + // == rather than <= as we only care about the "ground level" not being destroyed + if (location.getY() == area.getMinGenHeight()) { event.setCancelled(true); return; }