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 a2d35e394c..b42da9eb23 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java @@ -30,6 +30,13 @@ public interface PluginManager { */ public Plugin getPlugin(String name); + /** + * Gets a list of all currently loaded plugins + * + * @return Array of Plugins + */ + public Plugin[] getPlugins(); + /** * Checks if the given plugin is enabled or not * 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 d9f25afa1d..15e25a6ae5 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -136,6 +136,10 @@ public final class SimplePluginManager implements PluginManager { return lookupNames.get(name); } + public Plugin[] getPlugins() { + return plugins.toArray(new Plugin[0]); + } + /** * Checks if the given plugin is enabled or not *