From de5b505ec544fe39c2a04278925d8e8e76859782 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Thu, 7 Mar 2019 17:33:47 +0100 Subject: [PATCH] Fix issues with shop sign opening and access permissions (Fixes #207) --- .../ChestShop/Listeners/Player/PlayerInteract.java | 11 +++++------ 1 file changed, 5 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 53737b7..ad83272 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java @@ -103,19 +103,18 @@ public class PlayerInteract implements Listener { return; } + if (ChestShopSign.hasPermission(player, OTHER_NAME_ACCESS, sign) && !ChestShopSign.isAdminShop(sign)) { - if (Properties.ALLOW_SIGN_CHEST_OPEN) { + if (Properties.ALLOW_SIGN_CHEST_OPEN && !(Properties.IGNORE_CREATIVE_MODE && player.getGameMode() == GameMode.CREATIVE)) { if (player.isSneaking() || player.isInsideVehicle() - || (Properties.IGNORE_CREATIVE_MODE && player.getGameMode() == GameMode.CREATIVE) - || (Properties.ALLOW_LEFT_CLICK_DESTROYING && action == LEFT_CLICK_BLOCK - && ChestShopSign.hasPermission(player, OTHER_NAME_DESTROY, sign))) { + || (Properties.ALLOW_LEFT_CLICK_DESTROYING && action == LEFT_CLICK_BLOCK && ChestShopSign.hasPermission(player, OTHER_NAME_DESTROY, sign))) { return; } - event.setCancelled(true); showChestGUI(player, block, sign); return; - } else if (Properties.IGNORE_ACCESS_PERMS || ChestShopSign.isOwner(player, sign)) { + } + if (Properties.IGNORE_ACCESS_PERMS || ChestShopSign.isOwner(player, sign)) { // don't allow owners or people with access to buy/sell at this shop return; }