diff --git a/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java index b42da9eb23..01656a4514 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java @@ -75,6 +75,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 * diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java index a3899f564c..91d2b3ba28 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/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);