Single module modding
This commit is contained in:
@@ -8,7 +8,7 @@ import type { WorldSave } from "@/server/game/saves.ts";
|
||||
// a mod that uses every part of the server api worth testing, and writes down what happened in its storage
|
||||
const SERVER_SCRIPT = `
|
||||
import type { BlockRef, ServerContext } from "cubi/server";
|
||||
export function setup(ctx: ServerContext) {
|
||||
export function server(ctx: ServerContext) {
|
||||
const log = (key: string, value: unknown = 1) => {
|
||||
const all = ctx.storage.get<Record<string, unknown[]>>("log") ?? {};
|
||||
(all[key] ??= []).push(value);
|
||||
@@ -153,7 +153,7 @@ function test_mods() {
|
||||
name: "Test",
|
||||
version: "1.0.0",
|
||||
dependencies: [{ id: "bworld", version: "*" }],
|
||||
scripts: { server: "scripts/server.ts" },
|
||||
main: "scripts/server.ts",
|
||||
}),
|
||||
);
|
||||
Deno.writeTextFileSync(
|
||||
|
||||
Reference in New Issue
Block a user