Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor
2022-12-23 16:56:54 +00:00
5 changed files with 19 additions and 7 deletions

View File

@ -1264,7 +1264,8 @@ class World implements ChunkManager{
private function tickChunk(int $chunkX, int $chunkZ) : void{
$chunk = $this->getChunk($chunkX, $chunkZ);
if($chunk === null){
throw new \InvalidArgumentException("Chunk is not loaded");
//the chunk may have been unloaded during a previous chunk's update (e.g. during BlockGrowEvent)
return;
}
foreach($this->getChunkEntities($chunkX, $chunkZ) as $entity){
$entity->onRandomUpdate();