mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Remove useless checks for plugins disabling other plugins (#5931)
This commit is contained in:
parent
2ab3393568
commit
b944205f60
@ -490,9 +490,6 @@ class PluginManager{
|
||||
public function disablePlugins() : void{
|
||||
while(count($this->enabledPlugins) > 0){
|
||||
foreach($this->enabledPlugins as $plugin){
|
||||
if(!$plugin->isEnabled()){
|
||||
continue; //in case a plugin disabled another plugin
|
||||
}
|
||||
$name = $plugin->getDescription()->getName();
|
||||
if(isset($this->pluginDependents[$name]) && count($this->pluginDependents[$name]) > 0){
|
||||
$this->server->getLogger()->debug("Deferring disable of plugin $name due to dependent plugins still enabled: " . implode(", ", array_keys($this->pluginDependents[$name])));
|
||||
@ -525,11 +522,7 @@ class PluginManager{
|
||||
|
||||
public function tickSchedulers(int $currentTick) : void{
|
||||
foreach($this->enabledPlugins as $pluginName => $p){
|
||||
if(isset($this->enabledPlugins[$pluginName])){
|
||||
//the plugin may have been disabled as a result of updating other plugins' schedulers, and therefore
|
||||
//removed from enabledPlugins; however, foreach will still see it due to copy-on-write
|
||||
$p->getScheduler()->mainThreadHeartbeat($currentTick);
|
||||
}
|
||||
$p->getScheduler()->mainThreadHeartbeat($currentTick);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user