From 26fee2ecccf88ce92d3aa234f6541341ca15884d Mon Sep 17 00:00:00 2001 From: fullwall Date: Wed, 17 Apr 2013 11:41:51 +0800 Subject: [PATCH] Add citizens.npc.createall permission for PEX users --- .../net/citizensnpcs/commands/NPCCommands.java | 2 +- src/main/java/net/citizensnpcs/editor/Editor.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/src/main/java/net/citizensnpcs/commands/NPCCommands.java index 07d2396c8..4834fb437 100644 --- a/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -293,7 +293,7 @@ public class NPCCommands { type = EntityType.PLAYER; } } - if (!sender.hasPermission("citizens.npc.create.*") + if (!sender.hasPermission("citizens.npc.create.*") && !sender.hasPermission("citizens.npc.createall") && !sender.hasPermission("citizens.npc.create." + type.name().toLowerCase().replace("_", ""))) throw new NoPermissionsException(); diff --git a/src/main/java/net/citizensnpcs/editor/Editor.java b/src/main/java/net/citizensnpcs/editor/Editor.java index c620a8f07..06aaef0c0 100644 --- a/src/main/java/net/citizensnpcs/editor/Editor.java +++ b/src/main/java/net/citizensnpcs/editor/Editor.java @@ -16,17 +16,17 @@ public abstract class Editor implements Listener { public abstract void end(); - private static final Map editing = new HashMap(); + private static final Map EDITING = new HashMap(); private static void enter(Player player, Editor editor) { editor.begin(); player.getServer().getPluginManager() .registerEvents(editor, player.getServer().getPluginManager().getPlugin("Citizens")); - editing.put(player.getName(), editor); + EDITING.put(player.getName(), editor); } public static void enterOrLeave(Player player, Editor editor) { - Editor edit = editing.get(player.getName()); + Editor edit = EDITING.get(player.getName()); if (edit == null) enter(player, editor); else if (edit.getClass() == editor.getClass()) @@ -36,22 +36,22 @@ public abstract class Editor implements Listener { } public static boolean hasEditor(Player player) { - return editing.containsKey(player.getName()); + return EDITING.containsKey(player.getName()); } public static void leave(Player player) { if (!hasEditor(player)) return; - Editor editor = editing.remove(player.getName()); + Editor editor = EDITING.remove(player.getName()); HandlerList.unregisterAll(editor); editor.end(); } public static void leaveAll() { - for (Entry entry : editing.entrySet()) { + for (Entry entry : EDITING.entrySet()) { entry.getValue().end(); HandlerList.unregisterAll(entry.getValue()); } - editing.clear(); + EDITING.clear(); } } \ No newline at end of file