Makes sure only the owner and players with stargate.admin.dye can dye stargate signs
This commit is contained in:
		@@ -222,9 +222,10 @@ public class PlayerEventListener implements Listener {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Allow players to apply dye to signs
 | 
					        //Allow players with permissions to apply dye to signs
 | 
				
			||||||
        EquipmentSlot hand = event.getHand();
 | 
					        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();
 | 
					            String itemName = player.getInventory().getItem(hand).getType().toString();
 | 
				
			||||||
            if (itemName.endsWith("DYE") || itemName.endsWith("INK_SAC")) {
 | 
					            if (itemName.endsWith("DYE") || itemName.endsWith("INK_SAC")) {
 | 
				
			||||||
                event.setUseInteractedBlock(Event.Result.ALLOW);
 | 
					                event.setUseInteractedBlock(Event.Result.ALLOW);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -141,6 +141,9 @@ permissions:
 | 
				
			|||||||
  stargate.admin.config:
 | 
					  stargate.admin.config:
 | 
				
			||||||
    description: Allows the player to change config values from the chat
 | 
					    description: Allows the player to change config values from the chat
 | 
				
			||||||
    default: false
 | 
					    default: false
 | 
				
			||||||
 | 
					  stargate.admin.dye:
 | 
				
			||||||
 | 
					    description: Allows this player to change the dye of any stargate's sign
 | 
				
			||||||
 | 
					    default: false
 | 
				
			||||||
  stargate.server:
 | 
					  stargate.server:
 | 
				
			||||||
    description: Allows the creation of a BungeeCord stargate going to any server
 | 
					    description: Allows the creation of a BungeeCord stargate going to any server
 | 
				
			||||||
    default: false
 | 
					    default: false
 | 
				
			||||||
@@ -152,4 +155,5 @@ permissions:
 | 
				
			|||||||
      stargate.admin.hidden: true
 | 
					      stargate.admin.hidden: true
 | 
				
			||||||
      stargate.admin.private: true
 | 
					      stargate.admin.private: true
 | 
				
			||||||
      stargate.admin.bungee: true
 | 
					      stargate.admin.bungee: true
 | 
				
			||||||
      stargate.admin.config: true
 | 
					      stargate.admin.config: true
 | 
				
			||||||
 | 
					      stargate.admin.dye: true
 | 
				
			||||||
		Reference in New Issue
	
	Block a user