Client side chunk sections

This commit is contained in:
2026-11-07 10:39:16 -03:00
parent 8e14e9842a
commit 71cbf901a5
19 changed files with 162 additions and 116 deletions
+3 -3
View File
@@ -139,9 +139,9 @@ Deno.test("a dimension's blocks go from its min_y to max_y - 1, and are sent and
// what clients get: every block from the bottom up
const chunk = decode_level_chunk(world.level_chunk(2, 0));
assertEquals(chunk.blocks.length, CHUNK_AREA * 384);
assertEquals(chunk.blocks[8], world.get_block_value(GROUND_X, -64, 0));
assertEquals(chunk.blocks[383 * CHUNK_AREA + 8], world.get_block_value(GROUND_X, 319, 0));
assertEquals(chunk.sections.length, 384 / 16);
assertEquals(chunk.sections[0].get(8), world.get_block_value(GROUND_X, -64, 0));
assertEquals(chunk.sections[23].get(15 * CHUNK_AREA + 8), world.get_block_value(GROUND_X, 319, 0));
// a column of ground: glass up to 69 and air above, all one block in every section but the one with the ground's
// top in it