Change imports
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2026 Paula Wisnievski
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
// bworld/engine: engine access, for what the game api doesn't cover yet. a mod needs "engine_access": true and a
|
||||
// cubi/engine: engine access, for what the game api doesn't cover yet. a mod needs "engine_access": true and a
|
||||
// game_version within one minor version in its manifest. see docs/modding/misc/engine.md
|
||||
//
|
||||
// this is bundled into each mod that imports it, so it only imports types: the engine and hook are the game's own,
|
||||
@@ -21,8 +21,8 @@ export interface Engine {
|
||||
client: ReturnType<typeof client_engine>;
|
||||
}
|
||||
|
||||
const api = (globalThis as unknown as Record<string, EngineGlobal | undefined>)["__bworld_engine"];
|
||||
if (!api) throw new Error("bworld/engine only works in a mod's script, loaded by the game");
|
||||
const api = (globalThis as unknown as Record<string, EngineGlobal | undefined>)["__cubi_engine"];
|
||||
if (!api) throw new Error("cubi/engine only works in a mod's script, loaded by the game");
|
||||
api.check_access();
|
||||
|
||||
export const engine = api.engine as Engine;
|
||||
|
||||
Reference in New Issue
Block a user