mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 09:10:00 +00:00
PluginManager: fixed updating disabled scheduler when plugins cause other plugins to be disabled from within scheduled tasks
This commit is contained in:
parent
d1dfbd95e2
commit
2efce35331
@ -471,10 +471,14 @@ class PluginManager{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function tickSchedulers(int $currentTick) : void{
|
public function tickSchedulers(int $currentTick) : void{
|
||||||
foreach($this->enabledPlugins as $p){
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function clearPlugins() : void{
|
public function clearPlugins() : void{
|
||||||
$this->disablePlugins();
|
$this->disablePlugins();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user