Fix CITIZENS-485 (require per-mob type permission in /npc create)

This commit is contained in:
fullwall 2013-03-15 18:39:18 +08:00
parent aa022f8fae
commit 131453f775

View File

@ -303,6 +303,9 @@ public class NPCCommands {
type = EntityType.PLAYER; 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); npc = npcRegistry.createNPC(type, name);
String msg = "You created [[" + npc.getName() + "]]"; String msg = "You created [[" + npc.getName() + "]]";