Change imports

This commit is contained in:
2026-11-04 21:51:26 -03:00
parent 98fa45ebd1
commit ba4b2a8798
270 changed files with 994 additions and 994 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ Each argument type reads its part of the text and suggests what could go there.
In the server script's `setup`:
```ts
import type { Player, ServerContext } from "bworld/server";
import type { Player, ServerContext } from "cubi/server";
export function setup(ctx: ServerContext) {
const { literal, argument, types } = ctx.commands;
+1 -1
View File
@@ -29,7 +29,7 @@ can change has to be in this file with its default.
`ctx.config` in the server script holds the settings, with the server's changes made:
```ts
import type { ServerContext } from "bworld/server";
import type { ServerContext } from "cubi/server";
interface Config {
max_speed: number;
+5 -5
View File
@@ -15,14 +15,14 @@ Prefer the Game API. Many mods hooking the same thing is a sign it should become
`game_version` has to be one minor version: `~0.1.0` (0.1.0 and later 0.1 patches) or an exact `0.1.2`. Loading the mod
on another version is a load error, so the server doesn't start with it.
Without `engine_access`, importing `bworld/engine` is an error in `check-mods`, when a `.bmod` loads, and when the
script runs. When players join from another site, the confirm screen marks mods that change the engine.
Without `engine_access`, importing `cubi/engine` is an error in `check-mods`, when a `.bmod` loads, and when the script
runs. When players join from another site, the confirm screen marks mods that change the engine.
## Hooking
```ts
// server.ts: broken blocks drop twice
import { engine, hook } from "bworld/engine";
import { engine, hook } from "cubi/engine";
export function setup() {
hook(engine.server.GameServer.prototype, "pop_item", {
@@ -60,8 +60,8 @@ made changes too. It returns a function that unhooks it.
| `client` | client scripts | `Client`, `LocalPlayer`, `ClientLevel`, `GameRenderer`, `Camera`, `GuiScreen` |
The full lists are in `common/engine_modules.ts`, `server/game/engine_modules.ts` and `client/engine_modules.ts`. The
types are the engine's own source, so `check-mods` typechecks against exactly the engine the mod runs on.
`bworld/engine` also exports `game_version`, the version of the game that's running.
types are the engine's own source, so `check-mods` typechecks against exactly the engine the mod runs on. `cubi/engine`
also exports `game_version`, the version of the game that's running.
- Module exports can't be reassigned, so functions mods may want to change are on plain objects the engine calls
through: `engine.common.physics.move_body` is how every entity moves, on the server and on clients.