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:
parent
ff8701a7bf
commit
b99ad5a09a
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user