mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
DisablePluginException now can be used to disable plugins (#4780)
closes #2671
This commit is contained in:
@@ -444,7 +444,12 @@ class PluginManager{
|
||||
$this->server->getLogger()->info($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_enable($plugin->getDescription()->getFullName())));
|
||||
|
||||
$plugin->getScheduler()->setEnabled(true);
|
||||
$plugin->onEnableStateChange(true);
|
||||
try{
|
||||
$plugin->onEnableStateChange(true);
|
||||
}catch(DisablePluginException){
|
||||
$this->disablePlugin($plugin);
|
||||
}
|
||||
|
||||
if($plugin->isEnabled()){ //the plugin may have disabled itself during onEnable()
|
||||
$this->enabledPlugins[$plugin->getDescription()->getName()] = $plugin;
|
||||
|
||||
|
Reference in New Issue
Block a user