Move world generation outside the engine and into mods and data files
This commit is contained in:
@@ -13,6 +13,10 @@ import { clear_hooks, expose_engine } from "$/common/hooks.ts";
|
||||
import { common_engine } from "$/common/engine_modules.ts";
|
||||
import { server_engine } from "./engine_modules.ts";
|
||||
|
||||
// the generator worlds use: a mod's worldgen/noise_settings, the base game's overworld. the server doesn't start
|
||||
// without it
|
||||
const GENERATOR = "bworld:overworld";
|
||||
|
||||
export interface ServerModSource {
|
||||
listing: ModListing;
|
||||
data: ModData;
|
||||
@@ -42,7 +46,12 @@ export async function start_game(
|
||||
? [{ mod: mod.listing.id, url: mod.worldgen_url, engine_access: mod.listing.engine_access }]
|
||||
: []
|
||||
);
|
||||
const worldgen = await load_worldgen(worldgen_scripts, recipes.ores);
|
||||
const worldgen = await load_worldgen({
|
||||
mods: mods.map((mod) => mod.listing.id),
|
||||
scripts: worldgen_scripts,
|
||||
ores: recipes.ores,
|
||||
generator: GENERATOR,
|
||||
});
|
||||
|
||||
const runtime = new ModRuntime();
|
||||
// before the world loads, its mobs can have effects
|
||||
|
||||
Reference in New Issue
Block a user