Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor
2022-03-03 18:50:12 +00:00
3 changed files with 16 additions and 3 deletions

View File

@@ -435,10 +435,11 @@ class PluginManager{
$plugin->getScheduler()->setEnabled(true);
$plugin->onEnableStateChange(true);
if($plugin->isEnabled()){ //the plugin may have disabled itself during onEnable()
$this->enabledPlugins[$plugin->getDescription()->getName()] = $plugin;
$this->enabledPlugins[$plugin->getDescription()->getName()] = $plugin;
(new PluginEnableEvent($plugin))->call();
(new PluginEnableEvent($plugin))->call();
}
}
}

View File

@@ -130,6 +130,9 @@ class TaskScheduler{
}
public function mainThreadHeartbeat(int $currentTick) : void{
if(!$this->enabled){
throw new \LogicException("Cannot run heartbeat on a disabled scheduler");
}
$this->currentTick = $currentTick;
while($this->isReady($this->currentTick)){
/** @var TaskHandler $task */