1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-22 07:20:09 -08:00

Add plugin removal from the plugin manager.

This commit is contained in:
Danila Fedorin 2017-08-09 10:30:04 -07:00
parent ff8701a7bf
commit b99ad5a09a

View File

@ -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<? extends Plugin> 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. * Loads all the plugins in the PluginManager.
*/ */