diff --git a/src/main/java/net/knarcraft/stargate/listener/PlayerEventListener.java b/src/main/java/net/knarcraft/stargate/listener/PlayerEventListener.java index eb46e2c..b182690 100644 --- a/src/main/java/net/knarcraft/stargate/listener/PlayerEventListener.java +++ b/src/main/java/net/knarcraft/stargate/listener/PlayerEventListener.java @@ -222,9 +222,10 @@ public class PlayerEventListener implements Listener { return; } - //Allow players to apply dye to signs + //Allow players with permissions to apply dye to signs EquipmentSlot hand = event.getHand(); - if (hand != null) { + if (hand != null && (PermissionHelper.hasPermission(player, "stargate.admin.dye") || + portal.isOwner(player))) { String itemName = player.getInventory().getItem(hand).getType().toString(); if (itemName.endsWith("DYE") || itemName.endsWith("INK_SAC")) { event.setUseInteractedBlock(Event.Result.ALLOW); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 92399fb..ac9be07 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -141,6 +141,9 @@ permissions: stargate.admin.config: description: Allows the player to change config values from the chat default: false + stargate.admin.dye: + description: Allows this player to change the dye of any stargate's sign + default: false stargate.server: description: Allows the creation of a BungeeCord stargate going to any server default: false @@ -152,4 +155,5 @@ permissions: stargate.admin.hidden: true stargate.admin.private: true stargate.admin.bungee: true - stargate.admin.config: true \ No newline at end of file + stargate.admin.config: true + stargate.admin.dye: true \ No newline at end of file