Adds a permission for usage, and updates to 1.19.2
This commit is contained in:
		
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							@@ -46,7 +46,7 @@
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.spigotmc</groupId>
 | 
			
		||||
            <artifactId>spigot-api</artifactId>
 | 
			
		||||
            <version>1.19.1-R0.1-SNAPSHOT</version>
 | 
			
		||||
            <version>1.19.2-R0.1-SNAPSHOT</version>
 | 
			
		||||
            <scope>provided</scope>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
package net.knarcraft.blacksmith.listener;
 | 
			
		||||
 | 
			
		||||
import net.knarcraft.blacksmith.trait.BlacksmithTrait;
 | 
			
		||||
import net.knarcraft.blacksmith.util.MessageFormatter;
 | 
			
		||||
import org.bukkit.entity.Player;
 | 
			
		||||
import org.bukkit.event.EventHandler;
 | 
			
		||||
import org.bukkit.event.Listener;
 | 
			
		||||
@@ -20,6 +21,13 @@ public class NPCClickListener implements Listener {
 | 
			
		||||
 | 
			
		||||
        //Perform any necessary pre-session work
 | 
			
		||||
        Player player = event.getClicker();
 | 
			
		||||
 | 
			
		||||
        //Permission check
 | 
			
		||||
        if (!player.hasPermission("blacksmith.use")) {
 | 
			
		||||
            MessageFormatter.displayErrorMessage(player, "You lack the necessary permission");
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!blacksmithTrait.prepareForSession(player)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,10 @@ permissions:
 | 
			
		||||
    default: op
 | 
			
		||||
    children:
 | 
			
		||||
      blacksmith.edit: true
 | 
			
		||||
      blacksmith.use: true
 | 
			
		||||
  blacksmith.edit:
 | 
			
		||||
    description: Allows changing settings for the selected blacksmith NPC
 | 
			
		||||
    default: op
 | 
			
		||||
    default: op
 | 
			
		||||
  blacksmith.use:
 | 
			
		||||
    description: Allows the player to repair items using blacksmiths
 | 
			
		||||
    default: true
 | 
			
		||||
		Reference in New Issue
	
	Block a user