mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-11 05:52:05 +00:00
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
This commit is contained in:
parent
0f932f7cc0
commit
a0f5ad1669
@ -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)");
|
||||
|
Loading…
x
Reference in New Issue
Block a user