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
+2 -2
View File
@@ -113,7 +113,7 @@ Deno.test("every chunk generated is saved whole, and saved again only when it ch
const [id, state] = untouched.palette[block];
return id === AIR_ID ? 0 : game.world.block_ids[id] | (state << 16);
}),
game.world.generated_blocks(5, 5),
game.world.generated_blocks(5, 5).to_flat(),
);
assertEquals(game.save().chunks, []);
@@ -152,7 +152,7 @@ Deno.test("saved chunks stay as they were saved, whatever generation makes there
const { saved } = await saved_with_old_terrain();
const { game } = await test_game("mods", saved);
assertEquals(game.world.get_block_id(3, 121, 5), "bworld:stone");
assertEquals(game.world.generated_blocks(0, 0)[index(3, 121, 5)], 0);
assertEquals(game.world.generated_blocks(0, 0).get(3, 121, 5), 0);
assertEquals(game.save().chunks.filter((c) => c.x === 0 && c.z === 0), []);
});