Makes sure only the owner and players with stargate.admin.dye can dye stargate signs
This commit is contained in:
parent
4cae54e46f
commit
071f1895de
@ -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);
|
||||
|
@ -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
|
||||
@ -153,3 +156,4 @@ permissions:
|
||||
stargate.admin.private: true
|
||||
stargate.admin.bungee: true
|
||||
stargate.admin.config: true
|
||||
stargate.admin.dye: true
|
Loading…
x
Reference in New Issue
Block a user