diff --git a/src/main/java/org/nwapw/abacus/plugin/PluginManager.java b/src/main/java/org/nwapw/abacus/plugin/PluginManager.java index 9ec48b4..46c9517 100644 --- a/src/main/java/org/nwapw/abacus/plugin/PluginManager.java +++ b/src/main/java/org/nwapw/abacus/plugin/PluginManager.java @@ -187,6 +187,24 @@ public class PluginManager { } } + /** + * Removes the plugin with the given class from the manager. + * @param toRemove the plugin to remove. + */ + public void removeClass(Class toRemove){ + if(!loadedPluginClasses.contains(toRemove)) return; + plugins.removeIf(plugin -> plugin.getClass() == toRemove); + loadedPluginClasses.remove(toRemove); + } + + /** + * Removes all plugins from this plugin manager. + */ + public void removeAll(){ + loadedPluginClasses.clear(); + plugins.clear(); + } + /** * Loads all the plugins in the PluginManager. */