From 997594d7c36c9bb123407856561e95b61d39b623 Mon Sep 17 00:00:00 2001 From: adman Date: Mon, 20 Apr 2026 20:23:25 +0200 Subject: [PATCH] fix chunk sections being one --- level/chunk_builder.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/level/chunk_builder.go b/level/chunk_builder.go index 1903f9e..ad242a3 100644 --- a/level/chunk_builder.go +++ b/level/chunk_builder.go @@ -37,8 +37,16 @@ func (cb *ChunkBuilder) FillAllById(block, biome int32) { cb.Blocks = make([][]int32, numSections) cb.Biomes = make([][]int32, numSections) for i := range cb.Blocks { - cb.Blocks[i] = blockSection - cb.Biomes[i] = biomeSection + + // Otherwise setting one block will set it also in all other sections because the slice is the same + var blocks = make([]int32, BlocksPerChunkSection) + copy(blocks, blockSection) + + var biomes = make([]int32, BiomesPerChunkSection) + copy(biomes, biomeSection) + + cb.Blocks[i] = blocks + cb.Biomes[i] = biomes } return }