From 9382958959c3c900a0e160079a4d499e4c0659e8 Mon Sep 17 00:00:00 2001 From: Moulberry Date: Thu, 9 Nov 2023 17:22:27 +0800 Subject: [PATCH] PlotSquared: Notify when permissions missing --- .../plotsquared/PlotSquaredIntegrationImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java b/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java index 19249c6..70057f6 100644 --- a/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java +++ b/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java @@ -50,7 +50,7 @@ public class PlotSquaredIntegrationImpl { BukkitPlayer plotPlayer = BukkitUtil.adapt(player); // == rather than <= as we only care about the "ground level" not being destroyed if (block.getY() == area.getMinGenHeight()) { - if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { + if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL, true)) { return false; } } @@ -70,17 +70,17 @@ public class PlotSquaredIntegrationImpl { return true; } } - return plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER); + return plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER, true); } // plot is 'done' if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { - return plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER); + return plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER, true); } return true; } BukkitPlayer pp = BukkitUtil.adapt(player); - return pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD); + return pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD, true); } static boolean canPlaceBlock(Player player, org.bukkit.Location loc) { @@ -98,20 +98,20 @@ public class PlotSquaredIntegrationImpl { } // check unowned plots if (!plot.hasOwner()) { - return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED); + return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED, true); } // player is breaking another player's plot if (!plot.isAdded(pp.getUUID())) { - return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER); + return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER, true); } // plot is 'done' if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { - return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER); + return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER, true); } return true; } - return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD); + return pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD, true); } }