mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
Merge branch 'stable' into next-minor
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user