diff --git a/src/main/java/com/Acrobot/ChestShop/ChestShop.java b/src/main/java/com/Acrobot/ChestShop/ChestShop.java index 377b087..b79b6aa 100644 --- a/src/main/java/com/Acrobot/ChestShop/ChestShop.java +++ b/src/main/java/com/Acrobot/ChestShop/ChestShop.java @@ -469,6 +469,7 @@ public class ChestShop extends JavaPlugin { map.put("shift-sells-in-stacks", getChartArray(Properties.SHIFT_SELLS_IN_STACKS)); map.put("shift-sells-everything", getChartArray(Properties.SHIFT_SELLS_EVERYTHING)); map.put("allow-sign-chest-open", getChartArray(!Properties.ALLOW_SIGN_CHEST_OPEN)); + map.put("sign-dying", getChartArray(!Properties.SIGN_DYING)); map.put("remove-empty-shops", getChartArray(!Properties.REMOVE_EMPTY_SHOPS)); map.put("remove-empty-chests", getChartArray(!Properties.REMOVE_EMPTY_CHESTS)); map.put("uses-server-economy-account", getChartArray(!Properties.SERVER_ECONOMY_ACCOUNT.isEmpty())); diff --git a/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java b/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java index 78e14cc..c820311 100644 --- a/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java +++ b/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java @@ -153,6 +153,9 @@ public class Properties { @ConfigurationComment("Can shop's chest be opened by owner with right-clicking a shop's sign?") public static boolean ALLOW_SIGN_CHEST_OPEN = false; + @ConfigurationComment("If true and in 1.14+, the owner of a chest shop can click with a dye / ink sac to dye the sign.") + public static boolean SIGN_DYING = true; + @ConfigurationComment("If true, when you left-click your own shop sign you won't open chest's inventory, but instead you will start destroying the sign.") public static boolean ALLOW_LEFT_CLICK_DESTROYING = true; 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 0d018af..ed6143c 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java @@ -125,6 +125,15 @@ public class PlayerInteract implements Listener { if (!AccessToggle.isIgnoring(player) && ChestShopSign.canAccess(player, sign) && !ChestShopSign.isAdminShop(sign)) { if (Properties.IGNORE_ACCESS_PERMS || ChestShopSign.isOwner(player, sign)) { + if ((player.getInventory().getItemInMainHand().getType().name().endsWith("DYE") + || player.getInventory().getItemInMainHand().getType().name().endsWith("INK_SAC")) + && action == RIGHT_CLICK_BLOCK) { + if (Properties.SIGN_DYING) { + return; + } else { + event.setCancelled(true); + } + } if (Properties.ALLOW_SIGN_CHEST_OPEN && !(Properties.IGNORE_CREATIVE_MODE && player.getGameMode() == GameMode.CREATIVE)) { if (player.isSneaking() || player.isInsideVehicle() || (Properties.ALLOW_LEFT_CLICK_DESTROYING && action == LEFT_CLICK_BLOCK)) {