From 491f566e2a29e887c35d8be184a7984372e9226b Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 23 Sep 2012 13:07:30 +0800 Subject: [PATCH] Revert "Implement new selector" This reverts commit 959b8b774f020f4dd825761251a1a58fbd16c9c1. --- src/main/java/net/citizensnpcs/Citizens.java | 9 ++------- .../net/citizensnpcs/command/command/NPCCommands.java | 2 +- .../npc/{CitizensNPCSelector.java => NPCSelector.java} | 7 ++----- 3 files changed, 5 insertions(+), 13 deletions(-) rename src/main/java/net/citizensnpcs/npc/{CitizensNPCSelector.java => NPCSelector.java} (95%) diff --git a/src/main/java/net/citizensnpcs/Citizens.java b/src/main/java/net/citizensnpcs/Citizens.java index 595fff6dc..a1f366154 100644 --- a/src/main/java/net/citizensnpcs/Citizens.java +++ b/src/main/java/net/citizensnpcs/Citizens.java @@ -14,7 +14,6 @@ import net.citizensnpcs.api.event.CitizensReloadEvent; import net.citizensnpcs.api.exception.NPCLoadException; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPCRegistry; -import net.citizensnpcs.api.npc.NPCSelector; import net.citizensnpcs.api.scripting.EventRegistrar; import net.citizensnpcs.api.scripting.ObjectProvider; import net.citizensnpcs.api.scripting.ScriptCompiler; @@ -37,7 +36,7 @@ import net.citizensnpcs.command.exception.WrappedCommandException; import net.citizensnpcs.editor.Editor; import net.citizensnpcs.npc.CitizensNPCRegistry; import net.citizensnpcs.npc.CitizensTraitFactory; -import net.citizensnpcs.npc.CitizensNPCSelector; +import net.citizensnpcs.npc.NPCSelector; import net.citizensnpcs.util.Messages; import net.citizensnpcs.util.Messaging; import net.citizensnpcs.util.StringHelper; @@ -121,10 +120,6 @@ public class Citizens extends JavaPlugin implements CitizensPlugin { return new File(getDataFolder(), "scripts"); } - public NPCSelector getSelector() { - return selector; - } - @Override public TraitFactory getTraitFactory() { return traitFactory; @@ -216,7 +211,7 @@ public class Citizens extends JavaPlugin implements CitizensPlugin { npcRegistry = new CitizensNPCRegistry(saves); traitFactory = new CitizensTraitFactory(); - selector = new CitizensNPCSelector(this); + selector = new NPCSelector(this); CitizensAPI.setImplementation(this); getServer().getPluginManager().registerEvents(new EventListen(), this); diff --git a/src/main/java/net/citizensnpcs/command/command/NPCCommands.java b/src/main/java/net/citizensnpcs/command/command/NPCCommands.java index 478a90f82..92ffe161e 100644 --- a/src/main/java/net/citizensnpcs/command/command/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/command/command/NPCCommands.java @@ -9,7 +9,6 @@ import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.event.PlayerCreateNPCEvent; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPCRegistry; -import net.citizensnpcs.api.npc.NPCSelector; import net.citizensnpcs.api.trait.Trait; import net.citizensnpcs.api.trait.trait.MobType; import net.citizensnpcs.api.trait.trait.Owner; @@ -22,6 +21,7 @@ import net.citizensnpcs.command.Requirements; import net.citizensnpcs.command.exception.CommandException; import net.citizensnpcs.command.exception.NoPermissionsException; import net.citizensnpcs.npc.CitizensNPC; +import net.citizensnpcs.npc.NPCSelector; import net.citizensnpcs.trait.Age; import net.citizensnpcs.trait.Behaviour; import net.citizensnpcs.trait.Controllable; diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPCSelector.java b/src/main/java/net/citizensnpcs/npc/NPCSelector.java similarity index 95% rename from src/main/java/net/citizensnpcs/npc/CitizensNPCSelector.java rename to src/main/java/net/citizensnpcs/npc/NPCSelector.java index e5420f3c2..63fec7406 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPCSelector.java +++ b/src/main/java/net/citizensnpcs/npc/NPCSelector.java @@ -8,7 +8,6 @@ import net.citizensnpcs.api.event.NPCRemoveEvent; import net.citizensnpcs.api.event.NPCRightClickEvent; import net.citizensnpcs.api.event.NPCSelectEvent; import net.citizensnpcs.api.npc.NPC; -import net.citizensnpcs.api.npc.NPCSelector; import net.citizensnpcs.api.trait.trait.Owner; import net.citizensnpcs.editor.Editor; import net.citizensnpcs.util.Messaging; @@ -25,16 +24,15 @@ import org.bukkit.plugin.Plugin; import com.google.common.collect.Lists; -public class CitizensNPCSelector implements Listener, NPCSelector { +public class NPCSelector implements Listener { private int consoleSelectedNPC = -1; private final Plugin plugin; - public CitizensNPCSelector(Plugin plugin) { + public NPCSelector(Plugin plugin) { this.plugin = plugin; Bukkit.getPluginManager().registerEvents(this, plugin); } - @Override public NPC getSelected(CommandSender sender) { if (sender instanceof Player) { List metadata = ((Player) sender).getMetadata("selected"); @@ -83,7 +81,6 @@ public class CitizensNPCSelector implements Listener, NPCSelector { } } - @Override public void select(CommandSender sender, NPC npc) { // Remove existing selection if any List selectors = npc.data().get("selectors", Lists.newArrayList());