Improve a buuuunch of textures and some reworks
This commit is contained in:
@@ -42,7 +42,12 @@ Deno.test("new players spawn on dry land, all in the same place", async () => {
|
||||
Deno.test("trees grow on the ground, never closer than 4 blocks, even across chunk borders", async () => {
|
||||
const { game } = await test_game("mods");
|
||||
const ids = game.world.block_ids;
|
||||
const log = ids["bworld:log"];
|
||||
const id_names = Object.fromEntries(Object.entries(ids).map(([name, id]) => [id, name]));
|
||||
const logs = new Set(
|
||||
["log", "spruce_log", "birch_log", "jungle_log", "acacia_log", "dark_oak_log", "cherry_log"].map((name) =>
|
||||
ids[`bworld:${name}`]
|
||||
),
|
||||
);
|
||||
const ground = new Set([ids["bworld:grass"], ids["bworld:dirt"], ids["bworld:snow"]]);
|
||||
|
||||
// the bottom log of every trunk, in world coordinates
|
||||
@@ -52,14 +57,14 @@ Deno.test("trees grow on the ground, never closer than 4 blocks, even across chu
|
||||
for (let cz = -6; cz < 6; cz++) {
|
||||
const { blocks, spills } = generate_raw_chunk(cx, cz, "trees-test", ids);
|
||||
blocks.forEach((block, i) => {
|
||||
if (block === log && ground.has(blocks[i - CHUNK_AREA])) {
|
||||
if (logs.has(block) && ground.has(blocks[i - CHUNK_AREA])) {
|
||||
const x = cx * 16 + (i % 16);
|
||||
const z = cz * 16 + Math.floor(i / 16) % 16;
|
||||
trunks.push([x, z]);
|
||||
}
|
||||
});
|
||||
for (let i = 3; i < spills.length; i += 4) {
|
||||
if (spills[i] === ids["bworld:leaves"]) spilled_leaves++;
|
||||
if (id_names[spills[i]]?.endsWith("leaves")) spilled_leaves++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user