Move world generation outside the engine and into mods and data files

This commit is contained in:
2026-10-11 00:33:59 -03:00
parent afe6e03d4c
commit 3d2b235f64
118 changed files with 8250 additions and 1108 deletions
+5 -1
View File
@@ -58,6 +58,10 @@ Deno.test("bad biome json is reported", () => {
assertEquals(validate_biome(PLAIN), []);
assert(validate_biome({ ...PLAIN, season: "monsoon" }).some((p) => p.startsWith("season")));
assert(validate_biome({ ...PLAIN, colors: { grass: "green" } }).some((p) => p.startsWith("colors.grass")));
assert(validate_biome({ ...PLAIN, trees: { chance: 2, kinds: ["palm"] } }).length === 2);
// which kinds of tree there are is up to the trees feature, see tests/wood_test.ts
assertEquals(validate_biome({ ...PLAIN, trees: { chance: 2, kinds: ["palm"] } }), [
"trees.chance must be a number from 0 to 1",
]);
assert(validate_biome({ ...PLAIN, trees: { chance: 1, kinds: [] } }).some((p) => p.startsWith("trees.kinds")));
assert(validate_biome({ id: "my_mod:flat" }).some((p) => p.startsWith("surface")));
});