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
+1 -11
View File
@@ -3,7 +3,7 @@
// imports mods' worldgen scripts and collects what they and mods' data add to generation: the generator, ores, and
// features, code and data, in the order they run. used by the game server
import type { FeatureBiome, FeatureChunk, FeatureStep, WorldgenContext } from "@/common/mod_api/worldgen.ts";
import type { FeatureChunk, FeatureStep, WorldgenContext } from "@/common/mod_api/worldgen.ts";
import type { OreJson } from "@/common/mod_data.ts";
import type { SetupFeature, WorldgenSetup } from "./generation.ts";
import { EverythingRegistry } from "./everything_registry.ts";
@@ -11,7 +11,6 @@ import { ModLoadError } from "./mod_loader.ts";
import { loading_mod } from "./hooks.ts";
import { compile_generator } from "./worldgen/generator.ts";
import type { WorldShape } from "./world_shape.ts";
import type { Biome } from "./worldgen/biomes.ts";
import {
compile_feature,
DEFAULT_STEP,
@@ -54,14 +53,6 @@ export async function load_worldgen(sources: WorldgenSources): Promise<WorldgenS
const types = new Map<string, FeatureType>();
const modifiers = new Map<string, PlacementModifier>();
const data_features = (EverythingRegistry.get_registry<FeatureJson>("features") ?? []).filter((f) => f);
const biomes = (EverythingRegistry.get_registry<Biome>("biomes") ?? []).filter((b) => b).map((
biome,
): FeatureBiome => ({
id: biome.id,
...(biome.trees
? { trees: { ...biome.trees, kinds: [...biome.trees.kinds], wood: { ...biome.trees.wood } } }
: {}),
}));
for (const { mod, url, engine_access } of sources.scripts) {
const own = (id: string, what: string) => {
@@ -98,7 +89,6 @@ export async function load_worldgen(sources: WorldgenSources): Promise<WorldgenS
if (modifiers.has(id)) throw new ModLoadError(mod, `placement modifier ${id} is registered twice`);
modifiers.set(id, modify as PlacementModifier);
},
biomes: () => biomes,
register_terrain(id) {
throw new ModLoadError(
mod,