Single module modding
This commit is contained in:
@@ -9,7 +9,7 @@ import { copy_dir, stone_floor, test_game } from "./helpers.ts";
|
||||
|
||||
const SERVER_SCRIPT = `
|
||||
import type { ServerContext } from "cubi/server";
|
||||
export function setup(ctx: ServerContext) {
|
||||
export function server(ctx: ServerContext) {
|
||||
const log = (event: unknown[]) => ctx.storage.set("log", [...ctx.storage.get<unknown[]>("log") ?? [], event]);
|
||||
ctx.components.register_block("testmod:clock", {
|
||||
on_scheduled_tick(block) { log([block.x, ctx.system.current_tick]); },
|
||||
@@ -54,7 +54,7 @@ function test_mods() {
|
||||
name: "Test",
|
||||
version: "1.0.0",
|
||||
dependencies: [{ id: "bworld", version: "*" }],
|
||||
scripts: { server: "scripts/server.ts" },
|
||||
main: "scripts/server.ts",
|
||||
});
|
||||
const block = (name: string, states: unknown[] = []) =>
|
||||
write(`blocks/${name}.json`, {
|
||||
|
||||
Reference in New Issue
Block a user