Skip to content

Commit

Permalink
Fix for not being able to destroy adjacent signs & new Message
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerOfPie committed Nov 7, 2021
1 parent 0a94459 commit 1f92c58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/shanerx/tradeshop/enumys/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -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:"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
}
}

Expand Down

0 comments on commit 1f92c58

Please sign in to comment.