unregister event listeners when plugin is disabled (better co-op with other plugins)

This commit is contained in:
walterhiggins 2013-03-18 08:37:58 +00:00
parent 777fb9ce5b
commit 79e05f2bc0

View file

@ -668,7 +668,6 @@ See [issue #69][issue69] for more information.
***/ ***/
global.refresh = function(){ global.refresh = function(){
__plugin.pluginLoader.disablePlugin(__plugin); __plugin.pluginLoader.disablePlugin(__plugin);
org.bukkit.event.HandlerList["unregisterAll(org.bukkit.plugin.Plugin)"](__plugin);
__plugin.pluginLoader.enablePlugin(__plugin); __plugin.pluginLoader.enablePlugin(__plugin);
}; };
@ -701,8 +700,8 @@ See [issue #69][issue69] for more information.
if (pluginData.persistent) if (pluginData.persistent)
save(pluginData.module.store, jsPluginsRootDirName + "/" + moduleName + "-store.txt"); save(pluginData.module.store, jsPluginsRootDirName + "/" + moduleName + "-store.txt");
} }
_runUnloadHandlers(); _runUnloadHandlers();
org.bukkit.event.HandlerList["unregisterAll(org.bukkit.plugin.Plugin)"](__plugin);
}); });