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
This commit is contained in:
dordsor21 2022-01-28 20:28:44 +00:00 committed by Jordan
parent 10c9425826
commit d6b2b41c89

View File

@ -354,7 +354,8 @@ public class BlockEventListener implements Listener {
Plot plot = area.getPlot(location); Plot plot = area.getPlot(location);
if (plot != null) { if (plot != null) {
BukkitPlayer plotPlayer = BukkitUtil.adapt(player); 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 if (!Permissions
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
@ -649,7 +650,8 @@ public class BlockEventListener implements Listener {
event.getBlock().breakNaturally(); 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); event.setCancelled(true);
return; return;
} }