Makes sure only the owner and players with stargate.admin.dye can dye stargate signs

This commit is contained in:
2022-01-26 14:57:15 +01:00
parent 4cae54e46f
commit 071f1895de
2 changed files with 8 additions and 3 deletions

View File

@ -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);