From 058bb3a91a9cdc69e124b42e57224bc42c296a68 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 29 Oct 2020 13:37:14 +0000 Subject: [PATCH] World: do not execute neighbour block updates on unloaded chunks we might also need to delay this if any adjacent chunk is also not loaded, in case the block wants to access adjacent blocks during its neighbour update. --- src/world/World.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/world/World.php b/src/world/World.php index 9b0975aa2..cc42b6593 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -740,6 +740,9 @@ class World implements ChunkManager{ while($this->neighbourBlockUpdateQueue->count() > 0){ $index = $this->neighbourBlockUpdateQueue->dequeue(); World::getBlockXYZ($index, $x, $y, $z); + if(!$this->isChunkLoaded($x >> 4, $z >> 4)){ + continue; + } $block = $this->getBlockAt($x, $y, $z); $block->readStateFromWorld(); //for blocks like fences, force recalculation of connected AABBs