summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupBridge/src/com
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-01-21 11:47:08 +0000
committerElgarL <ElgarL@palmergames.com>2012-01-21 11:47:08 +0000
commit4b61ac9043ff6088c4910d497e8ee18e13d5494b (patch)
treecfa621a3b42dc0b411b4180bc44e7633e1a5f8ca /EssentialsGroupBridge/src/com
parent72edfacfb8ccdc44450ad9a9bee930d68f251db6 (diff)
downloadEssentials-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/src/com')
-rw-r--r--EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/OverrideListener.java25
-rw-r--r--EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java21
2 files changed, 32 insertions, 14 deletions
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);
}
}
+
+
+
}
+
+