Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2022-03-03 18:50:12 +00:00
commit 2b81b53dfa
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 16 additions and 3 deletions

View File

@ -19,3 +19,12 @@ Released 19th February 2022.
## Fixes
- Fixed multiple players being able to sleep in the same bed.
- Fixed hitbox not resetting properly after swimming or gliding.
# 4.2.2
Released 2nd March 2022.
## Fixes
- Fixed crash in `/dumpmemory` due to usage of non-printable string keys in `CraftingManager`. Array contents in memory dumps are now rendered as prettified key-value pairs.
- Fixed output directory for `/dumpmemory`.
- `PlayerInventory->isHotbarSlot()` now correctly returns `false` when given `9`.
- Fixed ghost items left in the inventory when dropping tools while mining.

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 */