New modding system

This commit is contained in:
2026-09-26 17:33:07 -03:00
parent 86d5c39eab
commit 243ff52063
25 changed files with 1089 additions and 512 deletions
+4 -5
View File
@@ -19,9 +19,9 @@ export function mod_sources(mods_dir: string): ServerModSource[] {
id: mod.id,
name: String(mod.manifest?.name),
version: String(mod.manifest?.version),
hash: "source",
data: `mods/${mod.id}/source/data.json`,
sha256: { data: "" },
sha256: "source",
file: `mods/${mod.id}.bmod`,
size: 0,
},
data: {
blocks: mod.blocks.map((b) => b.json),
@@ -50,8 +50,7 @@ export async function test_game(mods_dir: string, save?: string, seed = "test-se
closed.add(conn);
},
};
const atlas = { png: "atlas.png", json: "atlas.json", sha256: { png: "", json: "" } };
const game: GameServer = await start_game(host, save, seed, atlas, mod_sources(mods_dir));
const game: GameServer = await start_game(host, save, seed, mod_sources(mods_dir));
// deno-lint-ignore no-explicit-any
const take = (conn: number): any[] => {
const messages = outbox.get(conn) ?? [];