mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 19:59:11 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user