diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-01-21 11:47:08 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-01-21 11:47:08 +0000 |
commit | 4b61ac9043ff6088c4910d497e8ee18e13d5494b (patch) | |
tree | cfa621a3b42dc0b411b4180bc44e7633e1a5f8ca /EssentialsGroupBridge | |
parent | 72edfacfb8ccdc44450ad9a9bee930d68f251db6 (diff) | |
download | Essentials-4b61ac9043ff6088c4910d497e8ee18e13d5494b.tar Essentials-4b61ac9043ff6088c4910d497e8ee18e13d5494b.tar.gz Essentials-4b61ac9043ff6088c4910d497e8ee18e13d5494b.tar.lz Essentials-4b61ac9043ff6088c4910d497e8ee18e13d5494b.tar.xz Essentials-4b61ac9043ff6088c4910d497e8ee18e13d5494b.zip |
Update to new Bukkit Event system.
Update GroupManagerBridge for new event system.
Diffstat (limited to 'EssentialsGroupBridge')
3 files changed, 34 insertions, 16 deletions
diff --git a/EssentialsGroupBridge/.classpath b/EssentialsGroupBridge/.classpath index a1bc47710..9330eb06e 100644 --- a/EssentialsGroupBridge/.classpath +++ b/EssentialsGroupBridge/.classpath @@ -2,8 +2,8 @@ <classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="../lib/bukkit-0.0.1-SNAPSHOT.jar"/>
- <classpathentry kind="lib" path="../lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="../lib/bukkit.jar"/>
+ <classpathentry kind="lib" path="../lib/craftbukkit.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/EssentialsGroupManager"/>
<classpathentry kind="lib" path="../lib/Permissions3.jar"/>
<classpathentry kind="output" path="bin"/>
diff --git a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/OverrideListener.java b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/OverrideListener.java new file mode 100644 index 000000000..762e42b49 --- /dev/null +++ b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/OverrideListener.java @@ -0,0 +1,25 @@ +package com.nijikokun.bukkit.Permissions;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.server.PluginEnableEvent;
+import org.bukkit.event.Listener;
+
+
+
+public class OverrideListener implements Listener {
+
+ Permissions permClass;
+
+ OverrideListener(Permissions instance) {
+ this.permClass = instance;
+ }
+
+ @EventHandler(priority = EventPriority.NORMAL)
+ public void onPluginEnable(PluginEnableEvent event) {
+ if (event.getPlugin().getDescription().getName().equals("GroupManager")) {
+ permClass.setGM(event.getPlugin());
+ }
+ }
+
+}
\ No newline at end of file diff --git a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java index 5d027cccc..99fd18ce8 100644 --- a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java +++ b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java @@ -4,10 +4,6 @@ import com.nijiko.permissions.PermissionHandler; import java.util.logging.Logger; //import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy; -import org.bukkit.event.Event.Priority; -import org.bukkit.event.Event.Type; -import org.bukkit.event.server.PluginEnableEvent; -import org.bukkit.event.server.ServerListener; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; @@ -41,15 +37,7 @@ public class Permissions extends JavaPlugin { setGM(p); } else { if (this.getServer() != null) { - this.getServer().getPluginManager().registerEvent(Type.PLUGIN_ENABLE, new ServerListener() { - - @Override - public void onPluginEnable(PluginEnableEvent event) { - if (event.getPlugin().getDescription().getName().equals("GroupManager")) { - Permissions.this.setGM(event.getPlugin()); - } - } - }, Priority.Normal, this); + this.getServer().getPluginManager().registerEvents(new OverrideListener(this), this); } } } else { @@ -62,7 +50,7 @@ public class Permissions extends JavaPlugin { } } - private void setGM(final Plugin p) { + public void setGM(final Plugin p) { //GroupManager groupManager = (GroupManager) p; ((NijikoPermissionsProxy) Security).setGM(p); } @@ -79,4 +67,9 @@ public class Permissions extends JavaPlugin { Security = new NijikoPermissionsProxy(null); } } + + + } + + |