diff options
author | Taylor Kelly <tkelly910@gmail.com> | 2011-01-27 16:15:24 -0500 |
---|---|---|
committer | Taylor Kelly <tkelly910@gmail.com> | 2011-01-27 16:15:24 -0500 |
commit | 54059e34bbba4c35206952f9afb584bf9498e50a (patch) | |
tree | 2c32ab84e928ca3ba7dac9b6a7f3012076ea6803 /src | |
parent | 6c4698c313991c134ed80661e40750b837ec4b8d (diff) | |
download | bukkit-54059e34bbba4c35206952f9afb584bf9498e50a.tar bukkit-54059e34bbba4c35206952f9afb584bf9498e50a.tar.gz bukkit-54059e34bbba4c35206952f9afb584bf9498e50a.tar.lz bukkit-54059e34bbba4c35206952f9afb584bf9498e50a.tar.xz bukkit-54059e34bbba4c35206952f9afb584bf9498e50a.zip |
onDisable on stop - stephank
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/plugin/PluginManager.java | 5 | ||||
-rw-r--r-- | src/main/java/org/bukkit/plugin/SimplePluginManager.java | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java index b42da9eb..01656a45 100644 --- a/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/src/main/java/org/bukkit/plugin/PluginManager.java @@ -76,6 +76,11 @@ public interface PluginManager { public Plugin[] loadPlugins(File directory); /** + * Disables all the loaded plugins + */ + public void disablePlugins(); + + /** * Calls a player related event with the given details * * @param type Type of player related event to call diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index a3899f56..91d2b3ba 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -176,6 +176,12 @@ public final class SimplePluginManager implements PluginManager { } } + public void disablePlugins() { + for(Plugin plugin: getPlugins()) { + disablePlugin(plugin); + } + } + public void disablePlugin(final Plugin plugin) { if (plugin.isEnabled()) { plugin.getPluginLoader().disablePlugin(plugin); |