World sections

This commit is contained in:
2026-11-06 23:13:34 -03:00
parent 818ce22dd6
commit 1fa47c027d
21 changed files with 392 additions and 127 deletions
+4 -3
View File
@@ -13,10 +13,10 @@ Deno.test("the overworld generates the same way every time, with water only belo
for (let cx = -4; cx < 4; cx++) {
for (let cz = -4; cz < 4; cz++) {
const { blocks } = generate_raw_chunk(cx, cz, "worldgen-test", ids, game.world.worldgen);
const blocks = generate_raw_chunk(cx, cz, "worldgen-test", ids, game.world.worldgen).column.to_flat();
assertEquals(
blocks,
generate_raw_chunk(cx, cz, "worldgen-test", ids, game.world.worldgen).blocks,
generate_raw_chunk(cx, cz, "worldgen-test", ids, game.world.worldgen).column.to_flat(),
"same chunk, same blocks",
);
@@ -63,7 +63,8 @@ Deno.test("trees grow on the ground, never closer than 4 blocks, even across chu
let spilled_leaves = 0;
for (let cx = -6; cx < 6; cx++) {
for (let cz = -6; cz < 6; cz++) {
const { blocks, spills } = generate_raw_chunk(cx, cz, game.world.seed, ids, game.world.worldgen);
const { column, spills } = generate_raw_chunk(cx, cz, game.world.seed, ids, game.world.worldgen);
const blocks = column.to_flat();
blocks.forEach((block, i) => {
if (logs.has(block) && ground.has(blocks[i - CHUNK_AREA])) {
const x = cx * 16 + (i % 16);