mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-10-31 15:49:37 +01:00
ChestShop Sign Dying (#479)
Signed-off-by: TreyRuffy <TreyRuffy@users.noreply.github.com>
This commit is contained in:
parent
4f8e7938e2
commit
bb7bd3415c
@ -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()));
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user