diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 89b666f8d..67617f40c 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -1372,7 +1372,19 @@ class Level implements ChunkManager, Metadatable{ $block->y = $y; $block->z = $z; $block->level = $this; - $block->readStateFromWorld(); + + static $dynamicStateRead = false; + + if($dynamicStateRead){ + //this call was generated by a parent getBlock() call calculating dynamic stateinfo + //don't calculate dynamic state and don't add to block cache (since it won't have dynamic state calculated). + //this ensures that it's impossible for dynamic state properties to recursively depend on each other. + $addToCache = false; + }else{ + $dynamicStateRead = true; + $block->readStateFromWorld(); + $dynamicStateRead = false; + } if($addToCache and $blockHash !== null){ $this->blockCache[$chunkHash][$blockHash] = $block;