summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions')
-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);
}
}
+
+
+
}
+
+