Messy but working chicken

This commit is contained in:
2026-09-28 17:42:56 -03:00
parent fe149bb9ad
commit d606bc4b55
22 changed files with 622 additions and 21 deletions
+5
View File
@@ -6,6 +6,8 @@ import { load_worldgen } from "$/common/worldgen_loader.ts";
import { GameHost, GameServer } from "./game_server.ts";
import type { WorldSave } from "./saves.ts";
import { ModRuntime } from "./mod_runtime.ts";
import { register_entity_type } from "./entity/entity_types.ts";
import { mod_entity_factory } from "./entity/mod_entity.ts";
export interface ServerModSource {
listing: ModListing;
@@ -22,6 +24,9 @@ export async function start_game(
mods: ServerModSource[],
): Promise<GameServer> {
const recipes = register_mod_data(mods.map((mod) => ({ id: mod.listing.id, data: mod.data })));
for (const mod of mods) {
for (const json of mod.data.entities) register_entity_type(json.id, mod_entity_factory(json));
}
const worldgen_scripts = mods.flatMap((mod) =>
mod.worldgen_url ? [{ mod: mod.listing.id, url: mod.worldgen_url }] : []