mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
onDisable on stop - stephank
By: Taylor Kelly <tkelly910@gmail.com>
This commit is contained in:
parent
b26b68a61a
commit
be759ba36e
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue