From 131453f775727dc4c0eae933c1ba6f9222b6fc0c Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 15 Mar 2013 18:39:18 +0800 Subject: [PATCH] Fix CITIZENS-485 (require per-mob type permission in /npc create) --- src/main/java/net/citizensnpcs/commands/NPCCommands.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/src/main/java/net/citizensnpcs/commands/NPCCommands.java index 5f7477960..fbe8d8407 100644 --- a/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -303,6 +303,9 @@ public class NPCCommands { type = EntityType.PLAYER; } } + if (!sender.hasPermission("citizens.npc.create.*") + && !sender.hasPermission("citizens.npc.create." + type.name().toLowerCase().replace("_", ""))) + throw new NoPermissionsException(); npc = npcRegistry.createNPC(type, name); String msg = "You created [[" + npc.getName() + "]]";