Biome as data
This commit is contained in:
+3
-2
@@ -3,7 +3,7 @@ import { CHUNK_AREA, CHUNK_SIZE } from "$/common/constants.ts";
|
||||
import { Container, ItemStack } from "$/common/inventory.ts";
|
||||
import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts";
|
||||
import { generate_raw_chunk } from "$/common/generation.ts";
|
||||
import { BIOME_TREES, tree_wood } from "$/common/worldgen/trees.ts";
|
||||
import { get_biome, tree_wood } from "$/common/worldgen/biomes.ts";
|
||||
import { update_crafting_result } from "$/server/game/crafting.ts";
|
||||
import { test_game } from "./helpers.ts";
|
||||
|
||||
@@ -63,7 +63,8 @@ Deno.test("trees grow the wood of their kind and biome", async () => {
|
||||
if (!wood || !ground.has(blocks[i - CHUNK_AREA])) return;
|
||||
const column = i % CHUNK_AREA;
|
||||
const biome = biomes[column];
|
||||
const allowed = BIOME_TREES[biome].kinds.map((kind) => tree_wood(kind, biome));
|
||||
const info = get_biome(biome)!;
|
||||
const allowed = info.trees!.kinds.map((kind) => tree_wood(kind, info));
|
||||
assert(
|
||||
allowed.includes(wood as never),
|
||||
`${wood} in ${biome} at ${cx * CHUNK_SIZE}, ${cz * CHUNK_SIZE}`,
|
||||
|
||||
Reference in New Issue
Block a user