diff options
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); |