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.
This commit is contained in:
Dylan K. Taylor 2020-10-29 13:37:14 +00:00
parent cfb9cc8999
commit 058bb3a91a

View File

@ -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