Fixed plugin listener

This commit is contained in:
Tim Visée 2015-11-20 19:56:06 +01:00
parent 5df1dc2dfb
commit f17f1fe5fb

View File

@ -34,7 +34,7 @@ public class AuthMePluginListener implements Listener {
@EventHandler @EventHandler
public void onPluginEnable(PluginEnableEvent event) { public void onPluginEnable(PluginEnableEvent event) {
// Call the onPluginEnable method in the permissions manager // Call the onPluginEnable method in the permissions manager
Core.getPermissionsManager().onPluginEnable(event); this.instance.getPermissionsManager().onPluginEnable(event);
} }
/** /**
@ -51,16 +51,11 @@ public class AuthMePluginListener implements Listener {
if(plugin == null) if(plugin == null)
return; return;
// Make sure it's not Dungeon Maze itself // Make sure it's not this plugin itself
if(plugin.equals(DungeonMaze.instance)) if(plugin.equals(this.instance))
return; return;
// Call the onPluginDisable method in the permissions manager // Call the onPluginDisable method in the permissions manager
Core.getPermissionsManager().onPluginDisable(event); this.instance.getPermissionsManager().onPluginDisable(event);
// Check if this plugin is hooked in to Dungeon Maze
if(Core.getApiController().isHooked(plugin))
// Unhook the plugin from Dungeon Maze and unregister it's API sessions
Core.getApiController().unhookPlugin(plugin);
} }
} }