Mod config

This commit is contained in:
2026-10-14 14:14:52 -03:00
parent d7f1b91c0a
commit cedc7725b5
20 changed files with 371 additions and 32 deletions
+4 -1
View File
@@ -24,6 +24,9 @@ export interface HostOptions {
build_dir: string;
// the .bmod files to load
server_mods_dir: string;
// <mod id>.json files that change mods' settings, see docs/modding/misc/config.md. without it every mod uses its
// own config.json
config_dir?: string;
// where DESKTOP_DOWNLOADS are, served at /dist/. without it there's nothing to download
dist_dir?: string;
// the world's folder: level.json, and the blocks in region/
@@ -44,7 +47,7 @@ export interface Host {
// throws when the mods have problems, saying what they are
export async function start_host(options: HostOptions): Promise<Host> {
const mods = await load_bmods(options.server_mods_dir, engine_texture_ids(options.build_dir));
const mods = await load_bmods(options.server_mods_dir, engine_texture_ids(options.build_dir), options.config_dir);
console.log(`Mods: ${mods.map((mod) => `${mod.listing.id} ${mod.listing.version}`).join(", ") || "none"}`);
// what players download, by path
const downloads = new Map(mods.map((mod) => [`/${mod.listing.file}`, mod.client_bytes]));