From c9b8e136d18d6a06eb0acfd3d9d50d8681fe1787 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Sun, 16 May 2021 00:06:01 +0100 Subject: [PATCH] Fix that shop info doesn't show when protected externally --- .../ChestShop/Listeners/Player/PlayerInteract.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java index 0a50996..5f14640 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java @@ -66,16 +66,14 @@ public class PlayerInteract implements Listener { if (Properties.USE_BUILT_IN_PROTECTION && uBlock.couldBeShopContainer(block)) { Sign sign = uBlock.getConnectedSign(block); if (sign != null) { - if (Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) { - return; - } - if (!Security.canAccess(player, block)) { - event.setCancelled(true); + if (!Security.canAccess(player, block, Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY)) { if (Permission.has(player, Permission.SHOPINFO)) { ChestShop.callEvent(new ShopInfoEvent(player, sign)); - } else { + event.setCancelled(true); + } else if (!Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) { Messages.ACCESS_DENIED.send(player); + event.setCancelled(true); } }