fix block count calculation in chunk sections; improve variable naming in tests

This commit is contained in:
adman
2026-05-05 23:12:02 +02:00
parent 62d12386e1
commit b2df88203d
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ func (c Chunk) ToStorage(version string) (toChunk *level.Chunk, err error) {
if err != nil {
return
}
toChunk.Sections[i].BlockCount = int16(level.CountStorage(toChunk.Sections[i].Blocks, 0))
toChunk.Sections[i].BlockCount = int16(level.BlocksPerChunkSection - level.CountStorage(toChunk.Sections[i].Blocks, 0))
} else {
toChunk.Sections[i].Blocks, err = f.FullWith(0) //TODO PALLETE index 0 if avial
if err != nil {