Single module modding

This commit is contained in:
2026-11-14 12:18:41 -03:00
parent 605008f584
commit 313098892e
134 changed files with 919 additions and 924 deletions
+3 -4
View File
@@ -32,14 +32,14 @@ Deno.test("changing a mod's config only changes settings it has, to the same kin
]);
});
Deno.test("a server script reads its mod's config, with the changes a test makes", async () => {
Deno.test("a mod's server phase reads its mod's config, with the changes a test makes", async () => {
const dir = Deno.makeTempDirSync({ prefix: "bworld_config_" });
copy_dir("mods/bworld", `${dir}/bworld`);
create_mod("copper_tools", "Copper Tools", dir);
Deno.writeTextFileSync(
`${dir}/copper_tools/scripts/server.ts`,
`${dir}/copper_tools/scripts/main.ts`,
`import type { ServerContext } from "cubi/server";
export function setup(ctx: ServerContext) {
export function server(ctx: ServerContext) {
ctx.components.register_block("copper_tools:announce", {});
ctx.commands.register("settings", {
description: "Shows the settings",
@@ -94,7 +94,6 @@ Deno.test("a server changes a mod's settings with config/<mod id>.json, and play
write_mod({
manifest: { format_version: 1, id: "tiny", name: "Tiny", version: "1.0.0" },
data,
scripts: {},
textures: new Map(),
}),
);