Move trees out of cubi

This commit is contained in:
2026-11-13 22:55:30 -03:00
parent d48fa8cca5
commit c74ddedd6e
23 changed files with 69 additions and 208 deletions
+6 -2
View File
@@ -94,11 +94,15 @@ export function bench_blocks(visual_blocks: ReadonlySet<number>): BenchBlocks {
const solid = all.filter((b) => plain(b) && cube(b) && layer(b) === "solid" && b.block.has_collision);
if (solid.length === 0) throw new Error("The benchmark needs a solid block to build its level with");
// what the world generator fills the ground with, and a biome with trees for its cover
// what the world generator fills the ground with, and a grassy biome for its cover
const by_key = ([a]: [string, unknown], [b]: [string, unknown]) => a.localeCompare(b);
const settings = EverythingRegistry.entries<NoiseSettingsJson>("noise_settings").sort(by_key)[0]?.[1];
const biomes = EverythingRegistry.entries<Biome>("biomes").sort(by_key).map(([, biome]) => biome);
const biome = biomes.find((biome) => biome.trees) ?? biomes[0];
const grassy = (biome: Biome) => {
const top = by_id(biome.surface.top);
return top !== undefined && tinted(top, "grass");
};
const biome = biomes.find(grassy) ?? biomes[0];
const stone = by_id(settings?.default_block) ?? solid[0];
const top = by_id(biome?.surface.top) ?? solid.find((b) => tinted(b, "grass")) ?? stone;
const filler = by_id(biome?.surface.filler) ?? stone;