Updated NBT library to get new ListTag handling features

This commit is contained in:
Dylan K. Taylor
2025-09-19 23:40:04 +01:00
parent 6d2d23a210
commit bbcc0c08b5
17 changed files with 72 additions and 115 deletions

View File

@@ -87,12 +87,10 @@ trait LegacyAnvilChunkTrait{
}
$subChunks = [];
$subChunksTag = $chunk->getListTag("Sections") ?? [];
$subChunksTag = $chunk->getListTag("Sections", CompoundTag::class) ?? [];
foreach($subChunksTag as $subChunk){
if($subChunk instanceof CompoundTag){
$y = $subChunk->getByte("Y");
$subChunks[$y] = $this->deserializeSubChunk($subChunk, clone $biomes3d, new \PrefixedLogger($logger, "Subchunk y=$y"));
}
$y = $subChunk->getByte("Y");
$subChunks[$y] = $this->deserializeSubChunk($subChunk, clone $biomes3d, new \PrefixedLogger($logger, "Subchunk y=$y"));
}
for($y = Chunk::MIN_SUBCHUNK_INDEX; $y <= Chunk::MAX_SUBCHUNK_INDEX; ++$y){
if(!isset($subChunks[$y])){