From 1f92c58d6e88c716a55bc3cb1b356e9f72dd4c28 Mon Sep 17 00:00:00 2001 From: Nathan Thor Date: Sun, 7 Nov 2021 15:04:39 -0800 Subject: [PATCH] Fix for not being able to destroy adjacent signs & new Message --- src/main/java/org/shanerx/tradeshop/enumys/Message.java | 1 + .../shanerx/tradeshop/listeners/ShopProtectionListener.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/shanerx/tradeshop/enumys/Message.java b/src/main/java/org/shanerx/tradeshop/enumys/Message.java index c40a0e2b..323e8696 100644 --- a/src/main/java/org/shanerx/tradeshop/enumys/Message.java +++ b/src/main/java/org/shanerx/tradeshop/enumys/Message.java @@ -76,6 +76,7 @@ public enum Message { NO_SIGHTED_SHOP(MessageSectionKeys.NONE, "&cNo shop in range!", "Text to display when a player is too far from a shop"), NO_TS_CREATE_PERMISSION(MessageSectionKeys.NONE, "&cYou don't have permission to create TradeShops!", "Text to display when a player attempts to setup a shoptype they are not allowed to create:"), NO_TS_DESTROY(MessageSectionKeys.NONE, "&cYou may not destroy that TradeShop", "Text to display when a player attempts to destroy a shop they do not own:"), + DESTROY_SHOP_SIGN_FIRST(MessageSectionKeys.NONE, "&cYou must destroy the shops sign first.", "Text to display when a player attempts to destroy a block with a shop sign attached to it:"), NO_TS_OPEN(MessageSectionKeys.NONE, "&cThat TradeShop does not belong to you", "Text to display when a player attempts to open a shop they do not own nor have been granted access to (1.6):"), ON_TRADE(MessageSectionKeys.NONE, "&aYou have traded your &e{AMOUNT2} {ITEM2} &afor &e{AMOUNT1} {ITEM1} &awith {SELLER}", "Text to display upon a successful trade:"), PLAYER_FULL(MessageSectionKeys.NONE, "&cYour inventory is full, please make room before trading items!", "Text to display when the players inventory is too full to recieve the trade:"), diff --git a/src/main/java/org/shanerx/tradeshop/listeners/ShopProtectionListener.java b/src/main/java/org/shanerx/tradeshop/listeners/ShopProtectionListener.java index 56910b8e..2cdd5bbb 100644 --- a/src/main/java/org/shanerx/tradeshop/listeners/ShopProtectionListener.java +++ b/src/main/java/org/shanerx/tradeshop/listeners/ShopProtectionListener.java @@ -246,8 +246,7 @@ public void onBlockBreak(BlockBreakEvent event) { } event.setCancelled(true); player.sendMessage(Message.NO_TS_DESTROY.getPrefixed()); - } else { - if (Setting.ALLOW_SIGN_BREAK.getBoolean()) return; + } else if (!block.getType().name().contains("SIGN")) { boolean ret = true; for (BlockFace face : Arrays.asList(BlockFace.UP, BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST)) { Block temp = block.getRelative(face); @@ -261,7 +260,7 @@ public void onBlockBreak(BlockBreakEvent event) { return; event.setCancelled(true); - player.sendMessage(Message.NO_TS_DESTROY.getPrefixed()); + player.sendMessage(Message.DESTROY_SHOP_SIGN_FIRST.getPrefixed()); } }