mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +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);
|
public Plugin[] loadPlugins(File directory);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables all the loaded plugins
|
||||||
|
*/
|
||||||
|
public void disablePlugins();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls a player related event with the given details
|
* 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) {
|
public void disablePlugin(final Plugin plugin) {
|
||||||
if (plugin.isEnabled()) {
|
if (plugin.isEnabled()) {
|
||||||
plugin.getPluginLoader().disablePlugin(plugin);
|
plugin.getPluginLoader().disablePlugin(plugin);
|
||||||
|
|
Loading…
Reference in a new issue