From a0f5ad166956536e36cc37e99151a8c6b5a37673 Mon Sep 17 00:00:00 2001 From: "Dylan T." Date: Fri, 27 Jun 2025 16:30:40 +0000 Subject: [PATCH] Fix remaining usage of deprecated getBlockLayers() in World.php - Replace getBlockLayers() with getBlockLayer() and getLiquidLayer() - Ensures all block layers are validated when setting chunks - Completes the migration away from the deprecated method --- src/world/World.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/World.php b/src/world/World.php index 96203e050..ead672881 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -2607,7 +2607,7 @@ class World implements ChunkManager{ public function setChunk(int $chunkX, int $chunkZ, Chunk $chunk) : void{ foreach($chunk->getSubChunks() as $subChunk){ - foreach($subChunk->getBlockLayers() as $blockLayer){ + foreach([$subChunk->getBlockLayer(), $subChunk->getLiquidLayer()] as $blockLayer){ foreach($blockLayer->getPalette() as $blockStateId){ if(!$this->blockStateRegistry->hasStateId($blockStateId)){ throw new \InvalidArgumentException("Provided chunk contains unknown/unregistered blocks (found unknown state ID $blockStateId)");