diff --git a/MODS.md b/MODS.md index 106651e..0bfef65 100644 --- a/MODS.md +++ b/MODS.md @@ -84,8 +84,8 @@ deno task build && deno task server # packs the mods and starts a se ## API Types -The API types are the reference for everything scripts can call. Scripts import them as `bworld/server`, `bworld/client` -and `bworld/worldgen`, and they live in [`common/mod_api/`](common/mod_api/). +The API types are the reference for everything scripts can call. Scripts import them as `cubi/server`, `cubi/client` and +`cubi/worldgen`, and they live in [`common/mod_api/`](common/mod_api/). A few parts of those types aren't built yet and throw when used: forms, custom screens, HUD elements and keybinds. [`docs/modding_plan.md`](docs/modding_plan.md) covers those, what else is planned, and the design behind the mod API. diff --git a/client/atlas.ts b/client/atlas.ts index d6e0329..a37013f 100644 --- a/client/atlas.ts +++ b/client/atlas.ts @@ -3,9 +3,9 @@ // the texture atlas: the engine's textures and every mod's in one image, built by the client when it joins a server // from the textures in the server's .bmod files -import { TEXTURE_SIZE } from "$/common/constants.ts"; -import type { SpriteRegion } from "$/common/constants.ts"; -import { type Animation, texture_animation, type TextureJson } from "$/common/texture_animation.ts"; +import { TEXTURE_SIZE } from "@/common/constants.ts"; +import type { SpriteRegion } from "@/common/constants.ts"; +import { type Animation, texture_animation, type TextureJson } from "@/common/texture_animation.ts"; import { AnimatedTexture } from "./texture_animations.ts"; export interface AtlasLayout { diff --git a/client/benchmark/bench_level.ts b/client/benchmark/bench_level.ts index bd2b044..e08a76b 100644 --- a/client/benchmark/bench_level.ts +++ b/client/benchmark/bench_level.ts @@ -6,13 +6,13 @@ // entities, visuals and changing blocks. it's made of what the loaded mods' worldgen data makes the ground of, and other // blocks picked by what they are (a cutout plant, a translucent cube), not by their ids import { Alea } from "@paulaboks/rng"; -import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { DEFAULT_MODEL } from "$/common/block_models.ts"; -import { OctaveNoise2D, OctaveNoise3D, smoothstep } from "$/common/worldgen/noise.ts"; -import { can_stand_on, default_block_value } from "$/common/utils.ts"; -import type { Biome } from "$/common/worldgen/biomes.ts"; -import type { NoiseSettingsJson } from "$/common/worldgen/data.ts"; +import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { DEFAULT_MODEL } from "@/common/block_models.ts"; +import { OctaveNoise2D, OctaveNoise3D, smoothstep } from "@/common/worldgen/noise.ts"; +import { can_stand_on, default_block_value } from "@/common/utils.ts"; +import type { Biome } from "@/common/worldgen/biomes.ts"; +import type { NoiseSettingsJson } from "@/common/worldgen/data.ts"; const SEED = "benchmark"; // chunks go from -LEVEL_RADIUS to LEVEL_RADIUS - 1 each way. the outermost ring is only there so the ones inside it diff --git a/client/benchmark/benchmark.ts b/client/benchmark/benchmark.ts index 9a68813..aba5c2f 100644 --- a/client/benchmark/benchmark.ts +++ b/client/benchmark/benchmark.ts @@ -7,17 +7,17 @@ // so what's around the player doesn't change the numbers. each scene is timed with frames paced by the display, then // with frames back to back (see render_debug.uncapped), after a warmup. meshing the whole level is timed too, the // first time and again. the report says what the computer and the browser are, see report.ts -import { Camera } from "$/client/camera.ts"; -import { ClientLevel } from "$/client/level/client_level.ts"; -import type { GameRenderer } from "$/client/rendering/game_renderer.ts"; -import { block_visuals } from "$/client/rendering/visuals.ts"; -import { draw_item } from "$/client/rendering/render_utils.ts"; -import { InputManager } from "$/client/input_manager.ts"; -import { type FrameSample, profiler } from "$/client/profiler.ts"; -import { RemotePlayer } from "$/client/entity/remote_player.ts"; -import { RemoteEntity } from "$/client/entity/remote_entity.ts"; -import { ItemEntity } from "$/client/entity/item_entity.ts"; -import { tick_texture_animations } from "$/client/texture_animations.ts"; +import { Camera } from "@/client/camera.ts"; +import { ClientLevel } from "@/client/level/client_level.ts"; +import type { GameRenderer } from "@/client/rendering/game_renderer.ts"; +import { block_visuals } from "@/client/rendering/visuals.ts"; +import { draw_item } from "@/client/rendering/render_utils.ts"; +import { InputManager } from "@/client/input_manager.ts"; +import { type FrameSample, profiler } from "@/client/profiler.ts"; +import { RemotePlayer } from "@/client/entity/remote_player.ts"; +import { RemoteEntity } from "@/client/entity/remote_entity.ts"; +import { ItemEntity } from "@/client/entity/item_entity.ts"; +import { tick_texture_animations } from "@/client/texture_animations.ts"; import { adapter_info, device, @@ -26,15 +26,15 @@ import { render_debug, render_stats, set_canvas_size, -} from "$/client/renderer/mod.ts"; -import { ID_MASK, SLOT_SIZE, STATE_SHIFT } from "$/common/constants.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { TIMES_OF_DAY } from "$/common/time.ts"; -import { type BlockRegistry, EverythingRegistry, RENDER_LAYERS } from "$/common/everything_registry.ts"; -import type { EntityJson } from "$/common/mod_data.ts"; -import type { ModListing } from "$/common/mod_loader.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import { display_name } from "$/common/utils.ts"; +} from "@/client/renderer/mod.ts"; +import { ID_MASK, SLOT_SIZE, STATE_SHIFT } from "@/common/constants.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { TIMES_OF_DAY } from "@/common/time.ts"; +import { type BlockRegistry, EverythingRegistry, RENDER_LAYERS } from "@/common/everything_registry.ts"; +import type { EntityJson } from "@/common/mod_data.ts"; +import type { ModListing } from "@/common/mod_loader.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { display_name } from "@/common/utils.ts"; import { bench_blocks, type BenchBlocks, diff --git a/client/client.ts b/client/client.ts index 9ed9ad5..d2deacc 100644 --- a/client/client.ts +++ b/client/client.ts @@ -22,11 +22,11 @@ import { InputManager } from "./input_manager.ts"; import { Connection } from "./network.ts"; import { PauseScreen } from "./gui/pause_screen.ts"; import { back_to_title } from "./gui/title_screen.ts"; -import { TICK_DELTA } from "$/common/constants.ts"; -import { Container } from "$/common/inventory.ts"; -import { PLAYER_MENU } from "$/common/protocol.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import type { EntityJson } from "$/common/mod_data.ts"; +import { TICK_DELTA } from "@/common/constants.ts"; +import { Container } from "@/common/inventory.ts"; +import { PLAYER_MENU } from "@/common/protocol.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import type { EntityJson } from "@/common/mod_data.ts"; import { tick_texture_animations } from "./texture_animations.ts"; import type { RenderBenchmark } from "./benchmark/benchmark.ts"; diff --git a/client/debug_ui.ts b/client/debug_ui.ts index 5959386..e4b3aa8 100644 --- a/client/debug_ui.ts +++ b/client/debug_ui.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { point_inside_rec } from "$/common/utils.ts"; -import { InputManager } from "$/client/input_manager.ts"; -import { TextInput } from "$/client/gui/widgets.ts"; +import { point_inside_rec } from "@/common/utils.ts"; +import { InputManager } from "@/client/input_manager.ts"; +import { TextInput } from "@/client/gui/widgets.ts"; import { begin_clip, draw_rect, draw_rect_stroke, draw_text, end_clip } from "./renderer/mod.ts"; const HEADER_HEIGHT = 24; diff --git a/client/entity/entity.ts b/client/entity/entity.ts index 3838de5..9dbc53b 100644 --- a/client/entity/entity.ts +++ b/client/entity/entity.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { physics } from "$/common/physics.ts"; +import { physics } from "@/common/physics.ts"; import type { ClientLevel } from "../level/client_level.ts"; // anything that exists in the level and moves, like minecraft's Entity. position is the middle of its feet. diff --git a/client/entity/item_entity.ts b/client/entity/item_entity.ts index 5fc931e..76a4995 100644 --- a/client/entity/item_entity.ts +++ b/client/entity/item_entity.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { ItemStack } from "$/common/inventory.ts"; -import type { EntityInfo } from "$/common/protocol.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import type { EntityInfo } from "@/common/protocol.ts"; import type { ClientLevel } from "../level/client_level.ts"; import { Entity } from "./entity.ts"; diff --git a/client/entity/local_player.ts b/client/entity/local_player.ts index 317063e..ea2fcac 100644 --- a/client/entity/local_player.ts +++ b/client/entity/local_player.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { PLAYER_EYE_HEIGHT, PLAYER_HEIGHT, PLAYER_SWIM_EYE_HEIGHT, TICK_DELTA } from "$/common/constants.ts"; -import { physics } from "$/common/physics.ts"; +import { PLAYER_EYE_HEIGHT, PLAYER_HEIGHT, PLAYER_SWIM_EYE_HEIGHT, TICK_DELTA } from "@/common/constants.ts"; +import { physics } from "@/common/physics.ts"; import type { Client } from "../client.ts"; import { InputManager } from "../input_manager.ts"; import { ClientInventories } from "../inventory.ts"; diff --git a/client/entity/player.ts b/client/entity/player.ts index 5cb32b9..c3d737b 100644 --- a/client/entity/player.ts +++ b/client/entity/player.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { PLAYER_EYE_HEIGHT, PLAYER_HEIGHT, PLAYER_SWIM_HEIGHT, PLAYER_WIDTH } from "$/common/constants.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import { PLAYER_EYE_HEIGHT, PLAYER_HEIGHT, PLAYER_SWIM_HEIGHT, PLAYER_WIDTH } from "@/common/constants.ts"; +import { ItemStack } from "@/common/inventory.ts"; import type { ClientLevel } from "../level/client_level.ts"; import type { Texture } from "../renderer/mod.ts"; import { decode_skin } from "../skins.ts"; diff --git a/client/entity/remote_entity.ts b/client/entity/remote_entity.ts index 97b2f78..e7e2d33 100644 --- a/client/entity/remote_entity.ts +++ b/client/entity/remote_entity.ts @@ -1,10 +1,10 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { EntityData, EntityEvent, EntityInfo } from "$/common/protocol.ts"; -import type { EntityJson } from "$/common/mod_data.ts"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import { wrap_angle } from "$/common/utils.ts"; +import type { EntityData, EntityEvent, EntityInfo } from "@/common/protocol.ts"; +import type { EntityJson } from "@/common/mod_data.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import { wrap_angle } from "@/common/utils.ts"; import type { ClientLevel } from "../level/client_level.ts"; import { Entity } from "./entity.ts"; diff --git a/client/entity/remote_player.ts b/client/entity/remote_player.ts index 12e837b..31c0687 100644 --- a/client/entity/remote_player.ts +++ b/client/entity/remote_player.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { EntityEvent, PlayerInfo } from "$/common/protocol.ts"; -import { TICK_DELTA } from "$/common/constants.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import type { EntityEvent, PlayerInfo } from "@/common/protocol.ts"; +import { TICK_DELTA } from "@/common/constants.ts"; +import { ItemStack } from "@/common/inventory.ts"; import type { ClientLevel } from "../level/client_level.ts"; import { Player } from "./player.ts"; diff --git a/client/fluid_rules.ts b/client/fluid_rules.ts index a2f6aa9..137e7de 100644 --- a/client/fluid_rules.ts +++ b/client/fluid_rules.ts @@ -4,7 +4,7 @@ // the fluids' rules from the mods' shared scripts on this client, the same as the server's (see common/fluids.ts), for // drawing fluids and naming them in tooltips. its own module so those don't import client/mods.ts, which loads the mods // and makes it again for each server's -import { FluidRules } from "$/common/fluids.ts"; +import { FluidRules } from "@/common/fluids.ts"; export let fluid_rules = new FluidRules(() => undefined); diff --git a/client/game_mode.ts b/client/game_mode.ts index 50430c9..623ab81 100644 --- a/client/game_mode.ts +++ b/client/game_mode.ts @@ -1,16 +1,16 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; -import { AIR, FACE_OFFSETS, TICK_DELTA } from "$/common/constants.ts"; +import { BlockRegistry, EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; +import { AIR, FACE_OFFSETS, TICK_DELTA } from "@/common/constants.ts"; import type { Client } from "./client.ts"; import type { BlockHitResult } from "./level/client_level.ts"; -import type { Container } from "$/common/inventory.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { box_overlaps_block, can_place, fluid_block, placement_target, waterlog_placement } from "$/common/utils.ts"; +import type { Container } from "@/common/inventory.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { box_overlaps_block, can_place, fluid_block, placement_target, waterlog_placement } from "@/common/utils.ts"; import { block_rules, predict_neighbors } from "./mods.ts"; -import { collision_shape_at } from "$/common/block_shapes.ts"; -import type { EntityJson } from "$/common/mod_data.ts"; +import { collision_shape_at } from "@/common/block_shapes.ts"; +import type { EntityJson } from "@/common/mod_data.ts"; import { RemoteEntity } from "./entity/remote_entity.ts"; import { Player } from "./entity/player.ts"; import type { Entity } from "./entity/entity.ts"; diff --git a/client/gui/chat_component.ts b/client/gui/chat_component.ts index ac56840..3ac4b9b 100644 --- a/client/gui/chat_component.ts +++ b/client/gui/chat_component.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { canvas, draw_rect, draw_text } from "$/client/renderer/mod.ts"; +import { canvas, draw_rect, draw_text } from "@/client/renderer/mod.ts"; const LINE_HEIGHT = 24; const VISIBLE_SECONDS = 10; diff --git a/client/gui/credits_screen.ts b/client/gui/credits_screen.ts index 3e74b90..119b0ae 100644 --- a/client/gui/credits_screen.ts +++ b/client/gui/credits_screen.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { Marked } from "marked"; -import { AssetManager } from "$/client/assets.ts"; -import { mod_credits } from "$/client/mods.ts"; -import { canvas, draw_rect } from "$/client/renderer/mod.ts"; +import { AssetManager } from "@/client/assets.ts"; +import { mod_credits } from "@/client/mods.ts"; +import { canvas, draw_rect } from "@/client/renderer/mod.ts"; import { GuiScreen } from "./gui_screen.ts"; // credits come from servers' mods, so markdown only: raw html is shown as text and links can't run code diff --git a/client/gui/debug_overlay.ts b/client/gui/debug_overlay.ts index d727aac..8a10024 100644 --- a/client/gui/debug_overlay.ts +++ b/client/gui/debug_overlay.ts @@ -1,15 +1,15 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { Client } from "$/client/client.ts"; -import { DebugUI } from "$/client/debug_ui.ts"; -import { format_clock } from "$/common/time.ts"; -import { profiler, type SectionStats } from "$/client/profiler.ts"; -import { canvas, gpu_timer, render_debug, render_stats } from "$/client/renderer/mod.ts"; -import { RENDER_LAYERS } from "$/common/everything_registry.ts"; -import { atlas_png } from "$/client/atlas.ts"; -import { RenderBenchmark } from "$/client/benchmark/benchmark.ts"; -import { format_report } from "$/client/benchmark/report.ts"; +import type { Client } from "@/client/client.ts"; +import { DebugUI } from "@/client/debug_ui.ts"; +import { format_clock } from "@/common/time.ts"; +import { profiler, type SectionStats } from "@/client/profiler.ts"; +import { canvas, gpu_timer, render_debug, render_stats } from "@/client/renderer/mod.ts"; +import { RENDER_LAYERS } from "@/common/everything_registry.ts"; +import { atlas_png } from "@/client/atlas.ts"; +import { RenderBenchmark } from "@/client/benchmark/benchmark.ts"; +import { format_report } from "@/client/benchmark/report.ts"; // how often the totals that go through every chunk are worked out again, so the overlay doesn't slow the frames it's // measuring diff --git a/client/gui/disconnected_screen.ts b/client/gui/disconnected_screen.ts index b93f53f..fb8eb41 100644 --- a/client/gui/disconnected_screen.ts +++ b/client/gui/disconnected_screen.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { canvas, draw_rect, draw_text, measure_text } from "$/client/renderer/mod.ts"; +import { canvas, draw_rect, draw_text, measure_text } from "@/client/renderer/mod.ts"; import { GuiScreen } from "./gui_screen.ts"; import { back_to_title } from "./title_screen.ts"; import { Button, TEXT_HEIGHT, TEXT_SCALE } from "./widgets.ts"; diff --git a/client/gui/gui_chat.ts b/client/gui/gui_chat.ts index 4ff2b3e..3f25343 100644 --- a/client/gui/gui_chat.ts +++ b/client/gui/gui_chat.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { GuiScreen } from "./gui_screen.ts"; -import { canvas, draw_rect, draw_text, measure_text } from "$/client/renderer/mod.ts"; +import { canvas, draw_rect, draw_text, measure_text } from "@/client/renderer/mod.ts"; import { InputManager } from "../input_manager.ts"; import type { Client } from "../client.ts"; -import { MAX_CHAT_LENGTH, type ServerMessage } from "$/common/protocol.ts"; -import type { Suggestion } from "$/common/commands.ts"; +import { MAX_CHAT_LENGTH, type ServerMessage } from "@/common/protocol.ts"; +import type { Suggestion } from "@/common/commands.ts"; import { TEXT_HEIGHT, TextInput } from "./widgets.ts"; const SCALE = 2; diff --git a/client/gui/gui_mod_screens.ts b/client/gui/gui_mod_screens.ts index 385bec9..652e642 100644 --- a/client/gui/gui_mod_screens.ts +++ b/client/gui/gui_mod_screens.ts @@ -3,8 +3,8 @@ // screens mods' client scripts make, see docs/modding/gui/index.md: the screens of their menus, and screens with no // menu. a mod's screen that throws is closed, with the error in the console -import { TICK_DELTA } from "$/common/constants.ts"; -import type { ClientMenu as ModClientMenu, MenuScreen, Screen } from "$/common/mod_api/client.ts"; +import { TICK_DELTA } from "@/common/constants.ts"; +import type { ClientMenu as ModClientMenu, MenuScreen, Screen } from "@/common/mod_api/client.ts"; import { canvas } from "../renderer/mod.ts"; import type { Client } from "../client.ts"; import type { ClientMenu } from "../menu.ts"; diff --git a/client/gui/gui_player_inventory.ts b/client/gui/gui_player_inventory.ts index 5e0fd65..389f5d5 100644 --- a/client/gui/gui_player_inventory.ts +++ b/client/gui/gui_player_inventory.ts @@ -3,11 +3,11 @@ import { GuiMenuScreen } from "./gui_screen.ts"; import type { LocalPlayer } from "../entity/local_player.ts"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import type { EffectJson } from "$/common/mod_data.ts"; -import { TICKS_PER_SECOND } from "$/common/constants.ts"; -import { display_name } from "$/common/utils.ts"; -import { ClientMessage, PLAYER_MENU_EXTRA } from "$/common/protocol.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import type { EffectJson } from "@/common/mod_data.ts"; +import { TICKS_PER_SECOND } from "@/common/constants.ts"; +import { display_name } from "@/common/utils.ts"; +import { ClientMessage, PLAYER_MENU_EXTRA } from "@/common/protocol.ts"; import { player_menu } from "../menu.ts"; import type { ModGraphics } from "./mod_graphics.ts"; import { draw_gui_player } from "../rendering/gui_player.ts"; diff --git a/client/gui/gui_screen.ts b/client/gui/gui_screen.ts index 10c9024..43fa61e 100644 --- a/client/gui/gui_screen.ts +++ b/client/gui/gui_screen.ts @@ -1,10 +1,10 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { SLOT_SIZE } from "$/common/constants.ts"; +import { SLOT_SIZE } from "@/common/constants.ts"; import { draw_gui_sprite, GUI_SCALE } from "./gui_sprites.ts"; -import { click_slot } from "$/common/inventory.ts"; -import { ClientMessage, CRAFTING_RESULT_SLOT, PLAYER_MENU } from "$/common/protocol.ts"; +import { click_slot } from "@/common/inventory.ts"; +import { ClientMessage, CRAFTING_RESULT_SLOT, PLAYER_MENU } from "@/common/protocol.ts"; import { point_inside_rec } from "../../common/utils.ts"; import { InputManager } from "../input_manager.ts"; import { ClientInventories } from "../inventory.ts"; diff --git a/client/gui/gui_sprites.ts b/client/gui/gui_sprites.ts index ea20b0d..2e3e61d 100644 --- a/client/gui/gui_sprites.ts +++ b/client/gui/gui_sprites.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { AssetManager } from "$/client/assets.ts"; -import type { Texture } from "$/client/renderer/mod.ts"; -import { draw_nine_slice } from "$/client/rendering/render_utils.ts"; +import { AssetManager } from "@/client/assets.ts"; +import type { Texture } from "@/client/renderer/mod.ts"; +import { draw_nine_slice } from "@/client/rendering/render_utils.ts"; import { GUI_ATLAS, type GuiSprite } from "./gui_atlas.ts"; // gui sprites are drawn 3 times bigger, like minecraft at gui scale 3. SLOT_SIZE is its 18 pixel slot at this scale diff --git a/client/gui/hud.ts b/client/gui/hud.ts index 20b2ecd..45faed6 100644 --- a/client/gui/hud.ts +++ b/client/gui/hud.ts @@ -1,14 +1,14 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { Client } from "$/client/client.ts"; -import type { LocalPlayer } from "$/client/entity/local_player.ts"; -import type { ClientInventories } from "$/client/inventory.ts"; -import { draw_item } from "$/client/rendering/render_utils.ts"; -import { canvas, draw_rect, draw_text, measure_text } from "$/client/renderer/mod.ts"; -import { display_name } from "$/common/utils.ts"; -import { clock } from "$/common/time.ts"; -import { biome_season } from "$/common/worldgen/biomes.ts"; +import type { Client } from "@/client/client.ts"; +import type { LocalPlayer } from "@/client/entity/local_player.ts"; +import type { ClientInventories } from "@/client/inventory.ts"; +import { draw_item } from "@/client/rendering/render_utils.ts"; +import { canvas, draw_rect, draw_text, measure_text } from "@/client/renderer/mod.ts"; +import { display_name } from "@/common/utils.ts"; +import { clock } from "@/common/time.ts"; +import { biome_season } from "@/common/worldgen/biomes.ts"; import { TEXT_HEIGHT, TEXT_SCALE } from "./widgets.ts"; import { draw_gui_sprite, GUI_SCALE } from "./gui_sprites.ts"; diff --git a/client/gui/mod_graphics.ts b/client/gui/mod_graphics.ts index 489f58f..cacd61f 100644 --- a/client/gui/mod_graphics.ts +++ b/client/gui/mod_graphics.ts @@ -4,13 +4,13 @@ // the immediate mode drawing mods' client scripts get (Graphics in common/mod_api/client.ts), on top of the renderer. // one per screen, so text inputs keep their text and focus while it's open. mods work in gui pixels, GUI_SCALE canvas // pixels each -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import type { Color, Graphics } from "$/common/mod_api/client.ts"; -import type { FluidVariant, KeyCode } from "$/common/mod_api/shared.ts"; -import { point_inside_rec } from "$/common/utils.ts"; -import { AssetManager } from "$/client/assets.ts"; -import { InputManager, type KeyCode as InputKey } from "$/client/input_manager.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import type { Color, Graphics } from "@/common/mod_api/client.ts"; +import type { FluidVariant, KeyCode } from "@/common/mod_api/shared.ts"; +import { point_inside_rec } from "@/common/utils.ts"; +import { AssetManager } from "@/client/assets.ts"; +import { InputManager, type KeyCode as InputKey } from "@/client/input_manager.ts"; import { begin_clip, canvas, @@ -20,9 +20,9 @@ import { end_clip, measure_text, Texture, -} from "$/client/renderer/mod.ts"; -import { draw_fluid, draw_item } from "$/client/rendering/render_utils.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; +} from "@/client/renderer/mod.ts"; +import { draw_fluid, draw_item } from "@/client/rendering/render_utils.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; import { draw_tooltip, item_tooltip, type TooltipLine } from "./tooltip.ts"; import { TEXT_HEIGHT, TEXT_SCALE, TextInput } from "./widgets.ts"; import { GUI_ATLAS } from "./gui_atlas.ts"; diff --git a/client/gui/pause_screen.ts b/client/gui/pause_screen.ts index 9b5eb02..bd511ae 100644 --- a/client/gui/pause_screen.ts +++ b/client/gui/pause_screen.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { Client } from "$/client/client.ts"; -import { canvas, draw_rect, draw_text, measure_text } from "$/client/renderer/mod.ts"; +import type { Client } from "@/client/client.ts"; +import { canvas, draw_rect, draw_text, measure_text } from "@/client/renderer/mod.ts"; import { GuiScreen } from "./gui_screen.ts"; import { Button, TEXT_HEIGHT } from "./widgets.ts"; import { CreditsScreen } from "./credits_screen.ts"; diff --git a/client/gui/title_screen.ts b/client/gui/title_screen.ts index a82509e..2f9b5a4 100644 --- a/client/gui/title_screen.ts +++ b/client/gui/title_screen.ts @@ -1,11 +1,11 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { MAX_NAME_LENGTH } from "$/common/protocol.ts"; -import { InputManager } from "$/client/input_manager.ts"; -import { canvas, draw_rect, draw_text, measure_text } from "$/client/renderer/mod.ts"; -import { default_server, HandshakeError, server_address, ServerAddress } from "$/client/handshake.ts"; -import { default_player_name } from "$/client/network.ts"; +import { MAX_NAME_LENGTH } from "@/common/protocol.ts"; +import { InputManager } from "@/client/input_manager.ts"; +import { canvas, draw_rect, draw_text, measure_text } from "@/client/renderer/mod.ts"; +import { default_server, HandshakeError, server_address, ServerAddress } from "@/client/handshake.ts"; +import { default_player_name } from "@/client/network.ts"; import { GuiScreen } from "./gui_screen.ts"; import { CreditsScreen } from "./credits_screen.ts"; import { Button, EditBox, TEXT_HEIGHT, TEXT_SCALE, TextInput } from "./widgets.ts"; diff --git a/client/gui/tooltip.ts b/client/gui/tooltip.ts index 1d6c9f5..3eeb4ba 100644 --- a/client/gui/tooltip.ts +++ b/client/gui/tooltip.ts @@ -3,14 +3,14 @@ // the box next to the mouse saying what an item is, like minecraft's: its name, the fluid in it, what it's worth, then // its lore -import { EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; -import { contained_fluid, type ItemStack, sell_value } from "$/common/inventory.ts"; -import { display_name } from "$/common/utils.ts"; -import { fluid_rules } from "$/client/fluid_rules.ts"; -import { canvas, draw_text, draw_texture_region, measure_text, type Texture } from "$/client/renderer/mod.ts"; -import { AssetManager } from "$/client/assets.ts"; -import type { MenuTank } from "$/common/protocol.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; +import { EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; +import { contained_fluid, type ItemStack, sell_value } from "@/common/inventory.ts"; +import { display_name } from "@/common/utils.ts"; +import { fluid_rules } from "@/client/fluid_rules.ts"; +import { canvas, draw_text, draw_texture_region, measure_text, type Texture } from "@/client/renderer/mod.ts"; +import { AssetManager } from "@/client/assets.ts"; +import type { MenuTank } from "@/common/protocol.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; import { draw_gui_sprite, GUI_SCALE } from "./gui_sprites.ts"; import { TEXT_HEIGHT, TEXT_SCALE } from "./widgets.ts"; diff --git a/client/gui/widgets.ts b/client/gui/widgets.ts index 4a1e527..989a218 100644 --- a/client/gui/widgets.ts +++ b/client/gui/widgets.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { point_inside_rec } from "$/common/utils.ts"; -import { InputManager, type KeyCode } from "$/client/input_manager.ts"; -import { draw_rect, draw_text, measure_text } from "$/client/renderer/mod.ts"; +import { point_inside_rec } from "@/common/utils.ts"; +import { InputManager, type KeyCode } from "@/client/input_manager.ts"; +import { draw_rect, draw_text, measure_text } from "@/client/renderer/mod.ts"; import { draw_gui_sprite } from "./gui_sprites.ts"; export const TEXT_SCALE = 2; diff --git a/client/handshake.ts b/client/handshake.ts index c3afe2f..5c31fe1 100644 --- a/client/handshake.ts +++ b/client/handshake.ts @@ -3,7 +3,7 @@ // connecting to a server and getting what it needs before joining, see docs/modding/networking/index.md: // hello -> welcome, download and check everything, ready -> join -import { ClientMessage, PROTOCOL_VERSION, ServerMessage } from "$/common/protocol.ts"; +import { ClientMessage, PROTOCOL_VERSION, ServerMessage } from "@/common/protocol.ts"; const CONNECT_TIMEOUT_MS = 5000; const TRUST_KEY_PREFIX = "bworld:trusted:"; diff --git a/client/inventory.ts b/client/inventory.ts index 0de39d3..8da9d6a 100644 --- a/client/inventory.ts +++ b/client/inventory.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { Container, Cursor } from "$/common/inventory.ts"; -import type { MenuSlotInfo } from "$/common/protocol.ts"; +import { Container, Cursor } from "@/common/inventory.ts"; +import type { MenuSlotInfo } from "@/common/protocol.ts"; // the local copies of the containers the server syncs to this player export class ClientInventories { diff --git a/client/level/client_level.ts b/client/level/client_level.ts index 275bee0..76776f8 100644 --- a/client/level/client_level.ts +++ b/client/level/client_level.ts @@ -8,10 +8,10 @@ import { fluid_block, fluid_in_cell, is_waterlogged, -} from "$/common/utils.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { decode_level_chunk } from "$/common/chunk_streaming.ts"; -import { DEFAULT_WATER_COLOR, foliage_color, grass_color, water_color } from "$/common/worldgen/biome_colors.ts"; +} from "@/common/utils.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { decode_level_chunk } from "@/common/chunk_streaming.ts"; +import { DEFAULT_WATER_COLOR, foliage_color, grass_color, water_color } from "@/common/worldgen/biome_colors.ts"; import { block_light_emission, block_light_opacity, @@ -20,7 +20,7 @@ import { is_fluid_block, RENDER_LAYERS, RenderLayer, -} from "$/common/everything_registry.ts"; +} from "@/common/everything_registry.ts"; import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, Faces, ID_MASK, VOID } from "../../common/constants.ts"; import { AssetManager } from "../assets.ts"; import { ChunkWorkerPool } from "../chunk_workers.ts"; @@ -29,8 +29,8 @@ import { create_index_buffer, create_vertex_buffer, destroy_buffer, Texture } fr import { crosses_planes } from "../workers/translucent_sort.ts"; import { Camera } from "../camera.ts"; import type { Entity } from "../entity/entity.ts"; -import type { ModelJson } from "$/common/block_models.ts"; -import { clip_shape, collision_shape_at, FULL_SHAPE, type Shape, shape_at } from "$/common/block_shapes.ts"; +import type { ModelJson } from "@/common/block_models.ts"; +import { clip_shape, collision_shape_at, FULL_SHAPE, type Shape, shape_at } from "@/common/block_shapes.ts"; import { BlockPredictions } from "./block_predictions.ts"; import { block_visuals, Visuals } from "../rendering/visuals.ts"; diff --git a/client/main.ts b/client/main.ts index ac93d2b..68b297e 100644 --- a/client/main.ts +++ b/client/main.ts @@ -10,8 +10,8 @@ import { connect, HandshakeError, is_trusted, join, remember_trust, ServerAddres import { build_atlas, engine_textures } from "./atlas.ts"; import { confirm_mods } from "./confirm_mods.ts"; import { set_texture_animations } from "./texture_animations.ts"; -import type { TextureJson } from "$/common/texture_animation.ts"; -import { ModLoadError } from "$/common/mod_loader.ts"; +import type { TextureJson } from "@/common/texture_animation.ts"; +import { ModLoadError } from "@/common/mod_loader.ts"; import { begin_drawing, canvas, diff --git a/client/menu.ts b/client/menu.ts index fbe45f3..cb4795f 100644 --- a/client/menu.ts +++ b/client/menu.ts @@ -3,7 +3,7 @@ // the client's copy of a menu, like neoforge's client menu: built from what the server sent when it opened, kept up // to date with what it syncs. clicks go to the server, which decides what they do -import { Container } from "$/common/inventory.ts"; +import { Container } from "@/common/inventory.ts"; import { CRAFTING_RESULT_SLOT, type MenuFluidSlotInfo, @@ -11,9 +11,9 @@ import { type MenuTank, PLAYER_MENU, PLAYER_MENU_EXTRA, -} from "$/common/protocol.ts"; +} from "@/common/protocol.ts"; import type { ClientInventories } from "./inventory.ts"; -import type { ItemStack as ApiItemStack } from "$/common/mod_api/client.ts"; +import type { ItemStack as ApiItemStack } from "@/common/mod_api/client.ts"; export interface ClientSlot { // where its item is on this client diff --git a/client/mods.ts b/client/mods.ts index 4a49ede..3f7fea3 100644 --- a/client/mods.ts +++ b/client/mods.ts @@ -3,9 +3,9 @@ // loads the mods the server lists: downloads their .bmod files, registers their data, then runs their client scripts. // see docs/modding/networking/index.md -import { AIR } from "$/common/constants.ts"; -import { BlockRegistry, EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import type { ClientContext, ClientMenu, InventoryOverlay, KeyMappings, MenuScreen } from "$/common/mod_api/client.ts"; +import { AIR } from "@/common/constants.ts"; +import { BlockRegistry, EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import type { ClientContext, ClientMenu, InventoryOverlay, KeyMappings, MenuScreen } from "@/common/mod_api/client.ts"; import { check_recipe_types, ModListing, @@ -14,25 +14,25 @@ import { RecipeBook, register_mod_data, shared_recipes_api, -} from "$/common/mod_loader.ts"; -import { type Bmod, read_bmod } from "$/common/bmod.ts"; -import { get_state_value, set_state_value, shared_items_api } from "$/common/utils.ts"; -import { BlockRules } from "$/common/block_rules.ts"; -import { fluid_exists, FluidRules, same_fluid } from "$/common/fluids.ts"; +} from "@/common/mod_loader.ts"; +import { type Bmod, read_bmod } from "@/common/bmod.ts"; +import { get_state_value, set_state_value, shared_items_api } from "@/common/utils.ts"; +import { BlockRules } from "@/common/block_rules.ts"; +import { fluid_exists, FluidRules, same_fluid } from "@/common/fluids.ts"; import { fluid_rules, set_fluid_rules } from "./fluid_rules.ts"; -import { covers_face, EMPTY_SHAPE, FULL_SHAPE, is_solid } from "$/common/block_shapes.ts"; -import type { SharedContext, SharedWorld } from "$/common/mod_api/shared.ts"; -import { tag_api } from "$/common/tags.ts"; -import { AIR_ID } from "$/common/protocol.ts"; +import { covers_face, EMPTY_SHAPE, FULL_SHAPE, is_solid } from "@/common/block_shapes.ts"; +import type { SharedContext, SharedWorld } from "@/common/mod_api/shared.ts"; +import { tag_api } from "@/common/tags.ts"; +import { AIR_ID } from "@/common/protocol.ts"; import type { Client } from "./client.ts"; import { code_url, fetch_verified } from "./handshake.ts"; import { GuiModScreen } from "./gui/gui_mod_screens.ts"; -import { clear_hooks, expose_engine, loading_mod } from "$/common/hooks.ts"; -import { common_engine } from "$/common/engine_modules.ts"; +import { clear_hooks, expose_engine, loading_mod } from "@/common/hooks.ts"; +import { common_engine } from "@/common/engine_modules.ts"; import { client_engine } from "./engine_modules.ts"; import { block_visuals } from "./rendering/visuals.ts"; -import { biome_season } from "$/common/worldgen/biomes.ts"; -import type { LootTableJson } from "$/common/loot.ts"; +import { biome_season } from "@/common/worldgen/biomes.ts"; +import type { LootTableJson } from "@/common/loot.ts"; // each loaded mod's credits file, for the credits screen export const mod_credits: { name: string; version: string; text: string }[] = []; diff --git a/client/network.ts b/client/network.ts index ed159e9..996097c 100644 --- a/client/network.ts +++ b/client/network.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { ClientMessage, EntityInfo, MenuSlotInfo, PlayerInfo, ServerMessage } from "$/common/protocol.ts"; -import type { ModListing } from "$/common/mod_loader.ts"; +import { ClientMessage, EntityInfo, MenuSlotInfo, PlayerInfo, ServerMessage } from "@/common/protocol.ts"; +import type { ModListing } from "@/common/mod_loader.ts"; import type { Join, ServerSocket, Welcome } from "./handshake.ts"; export class Connection { diff --git a/client/packet_listener.ts b/client/packet_listener.ts index 52f8570..d410199 100644 --- a/client/packet_listener.ts +++ b/client/packet_listener.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { ServerMessage } from "$/common/protocol.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import type { ServerMessage } from "@/common/protocol.ts"; +import { ItemStack } from "@/common/inventory.ts"; import type { Client } from "./client.ts"; import { GuiModMenuScreen } from "./gui/gui_mod_screens.ts"; import { ClientMenu } from "./menu.ts"; diff --git a/client/renderer/core.ts b/client/renderer/core.ts index 0715b62..0254c42 100644 --- a/client/renderer/core.ts +++ b/client/renderer/core.ts @@ -3,7 +3,7 @@ import type { Camera } from "../camera.ts"; import { mat4 } from "gl-matrix"; -import type { RenderLayer } from "$/common/everything_registry.ts"; +import type { RenderLayer } from "@/common/everything_registry.ts"; import { TERRAIN_VERTEX_BYTES } from "../workers/chunk_messages.ts"; import { GpuTimer } from "./gpu_timing.ts"; diff --git a/client/rendering/entity_light.ts b/client/rendering/entity_light.ts index 2b96690..ee7b6f7 100644 --- a/client/rendering/entity_light.ts +++ b/client/rendering/entity_light.ts @@ -3,9 +3,9 @@ // lighting entities like minecraft: one light level per entity each frame, at its eyes, looked up in the same lightmap // as terrain and multiplied into its vertex colors. burning ones have full block light -import type { Entity } from "$/client/entity/entity.ts"; -import type { ClientLevel } from "$/client/level/client_level.ts"; -import { light_color } from "$/client/renderer/mod.ts"; +import type { Entity } from "@/client/entity/entity.ts"; +import type { ClientLevel } from "@/client/level/client_level.ts"; +import { light_color } from "@/client/renderer/mod.ts"; import type { Vec3 } from "./player_renderer.ts"; // the color for the light at a point, times tint (like the hurt flash) diff --git a/client/rendering/entity_renderer.ts b/client/rendering/entity_renderer.ts index 3fb6949..b3ff207 100644 --- a/client/rendering/entity_renderer.ts +++ b/client/rendering/entity_renderer.ts @@ -5,14 +5,14 @@ // animation files yet: the model turns to the entity's yaw, a bone named "head" to where it looks, and bones named // like minecraft's humanoid ones (right_arm, left_arm, right_leg, left_leg) swing as it walks, the right arm when it // attacks too. entities without a model are their texture facing the camera, like minecraft's fishing hook -import { AssetManager } from "$/client/assets.ts"; -import type { Camera } from "$/client/camera.ts"; -import type { RemoteEntity } from "$/client/entity/remote_entity.ts"; -import { push_vertex, type Texture } from "$/client/renderer/mod.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; -import type { SpriteRegion } from "$/common/constants.ts"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import type { EntityBoneJson, EntityJson, EntityModelJson } from "$/common/mod_data.ts"; +import { AssetManager } from "@/client/assets.ts"; +import type { Camera } from "@/client/camera.ts"; +import type { RemoteEntity } from "@/client/entity/remote_entity.ts"; +import { push_vertex, type Texture } from "@/client/renderer/mod.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; +import type { SpriteRegion } from "@/common/constants.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import type { EntityBoneJson, EntityJson, EntityModelJson } from "@/common/mod_data.ts"; import { HURT_TINT } from "./player_renderer.ts"; import { IDENTITY, model_pivot, multiply, rotation_around, type Vec3 } from "./model_math.ts"; import { push_model } from "./model_renderer.ts"; diff --git a/client/rendering/game_renderer.ts b/client/rendering/game_renderer.ts index e737b4e..62940f3 100644 --- a/client/rendering/game_renderer.ts +++ b/client/rendering/game_renderer.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { Client } from "$/client/client.ts"; -import type { Camera } from "$/client/camera.ts"; -import type { ClientLevel } from "$/client/level/client_level.ts"; +import type { Client } from "@/client/client.ts"; +import type { Camera } from "@/client/camera.ts"; +import type { ClientLevel } from "@/client/level/client_level.ts"; import { begin_mode_3d, canvas, @@ -12,14 +12,14 @@ import { end_mode_3d, set_render_time, update_lightmap, -} from "$/client/renderer/mod.ts"; -import { daylight } from "$/common/time.ts"; -import { Hud } from "$/client/gui/hud.ts"; -import { DebugOverlay } from "$/client/gui/debug_overlay.ts"; +} from "@/client/renderer/mod.ts"; +import { daylight } from "@/common/time.ts"; +import { Hud } from "@/client/gui/hud.ts"; +import { DebugOverlay } from "@/client/gui/debug_overlay.ts"; import { LevelRenderer } from "./level_renderer.ts"; import { HandRenderer } from "./hand_renderer.ts"; import { render_nameplates } from "./nameplate_renderer.ts"; -import { profiler } from "$/client/profiler.ts"; +import { profiler } from "@/client/profiler.ts"; // the sky at noon and in the middle of the night const DAY_SKY = [0.69, 0.8, 1]; diff --git a/client/rendering/gui_player.ts b/client/rendering/gui_player.ts index ebaaa49..33c616d 100644 --- a/client/rendering/gui_player.ts +++ b/client/rendering/gui_player.ts @@ -6,7 +6,7 @@ // they wear, like their curios. the gui has no depth buffer, so the faces are drawn back to front with the ones facing // away left out, like 3d items in slots import { push_vertex, type Texture, use_texture } from "../renderer/mod.ts"; -import type { ItemStack } from "$/common/inventory.ts"; +import type { ItemStack } from "@/common/inventory.ts"; import { AssetManager } from "../assets.ts"; import { rotation_around } from "./model_math.ts"; import { part_point, PARTS, type PlayerPose, pose_at, pose_to_world, SLIM_PARTS } from "./player_model.ts"; diff --git a/client/rendering/hand_renderer.ts b/client/rendering/hand_renderer.ts index e478502..10dcf24 100644 --- a/client/rendering/hand_renderer.ts +++ b/client/rendering/hand_renderer.ts @@ -5,9 +5,9 @@ // ItemInHandRenderer. with empty hands it's their right arm, in their skin, like minecraft's // FirstPersonHandsAndItemsRenderer.renderPlayerArm import { mat4, vec3 } from "gl-matrix"; -import type { ItemStack } from "$/common/inventory.ts"; -import { AssetManager } from "$/client/assets.ts"; -import type { LocalPlayer } from "$/client/entity/local_player.ts"; +import type { ItemStack } from "@/common/inventory.ts"; +import { AssetManager } from "@/client/assets.ts"; +import type { LocalPlayer } from "@/client/entity/local_player.ts"; import { begin_view_model, end_mode_3d, @@ -15,7 +15,7 @@ import { set_current_texture, Texture, use_texture, -} from "$/client/renderer/mod.ts"; +} from "@/client/renderer/mod.ts"; import { display_transform, drawn_as_model, item_model_of, push_item } from "./item_renderer.ts"; import { push_cube, type Vec3 } from "./player_renderer.ts"; import { right_arm } from "./player_model.ts"; diff --git a/client/rendering/item_model.ts b/client/rendering/item_model.ts index 5ee81d9..9472b0d 100644 --- a/client/rendering/item_model.ts +++ b/client/rendering/item_model.ts @@ -3,8 +3,8 @@ // the 3d model of a flat item, like minecraft's item/generated: its sprite on the front and back, one pixel apart, with // a side face along every edge between a pixel that can be seen and one that can't (or the sprite's border) -import { TEXTURE_SIZE } from "$/common/constants.ts"; -import { opaque_pixels, type OpaqueMask } from "$/client/atlas.ts"; +import { TEXTURE_SIZE } from "@/common/constants.ts"; +import { opaque_pixels, type OpaqueMask } from "@/client/atlas.ts"; export interface ItemQuad { // 4 corners counter clockwise seen from outside. x from -0.5 to 0.5 and y from 0 to 1 across the sprite, z its diff --git a/client/rendering/item_renderer.ts b/client/rendering/item_renderer.ts index 6c4a5a3..97675e2 100644 --- a/client/rendering/item_renderer.ts +++ b/client/rendering/item_renderer.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { mat4, vec3 } from "gl-matrix"; -import type { SpriteRegion } from "$/common/constants.ts"; -import { BlockRegistry, EverythingRegistry, type ItemLayer, ItemRegistry } from "$/common/everything_registry.ts"; -import { AssetManager } from "$/client/assets.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; -import type { ItemEntity } from "$/client/entity/item_entity.ts"; -import { contained_fluid, type ItemData, ItemStack } from "$/common/inventory.ts"; -import type { FluidVariant } from "$/common/mod_api/shared.ts"; -import type { FluidJson } from "$/common/mod_data.ts"; -import { light_color, push_vertex, Texture } from "$/client/renderer/mod.ts"; +import type { SpriteRegion } from "@/common/constants.ts"; +import { BlockRegistry, EverythingRegistry, type ItemLayer, ItemRegistry } from "@/common/everything_registry.ts"; +import { AssetManager } from "@/client/assets.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; +import type { ItemEntity } from "@/client/entity/item_entity.ts"; +import { contained_fluid, type ItemData, ItemStack } from "@/common/inventory.ts"; +import type { FluidVariant } from "@/common/mod_api/shared.ts"; +import type { FluidJson } from "@/common/mod_data.ts"; +import { light_color, push_vertex, Texture } from "@/client/renderer/mod.ts"; import { bake_model, type BakedQuad, @@ -24,15 +24,15 @@ import { item_tint, type ModelDisplay, type ModelJson, -} from "$/common/block_models.ts"; +} from "@/common/block_models.ts"; import { item_model, type ItemQuad } from "./item_model.ts"; -import { get_state_value, item_texture } from "$/common/utils.ts"; -import { ID_MASK, TEXTURE_SIZE } from "$/common/constants.ts"; -import type { ClientLevel } from "$/client/level/client_level.ts"; +import { get_state_value, item_texture } from "@/common/utils.ts"; +import { ID_MASK, TEXTURE_SIZE } from "@/common/constants.ts"; +import type { ClientLevel } from "@/client/level/client_level.ts"; import { entity_tint } from "./entity_light.ts"; import type { Vec3 } from "./player_renderer.ts"; -import { fluid_rules } from "$/client/fluid_rules.ts"; -import { color_rgb, tint_without_biome, type TintColor } from "$/common/worldgen/biome_colors.ts"; +import { fluid_rules } from "@/client/fluid_rules.ts"; +import { color_rgb, tint_without_biome, type TintColor } from "@/common/worldgen/biome_colors.ts"; // how big items on the ground are drawn, minecraft's ground transform const BLOCK_SCALE = 0.25; diff --git a/client/rendering/level_renderer.ts b/client/rendering/level_renderer.ts index bc7eba6..c6e58c9 100644 --- a/client/rendering/level_renderer.ts +++ b/client/rendering/level_renderer.ts @@ -1,15 +1,15 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { type Chunk, CHUNK_SIZE, type ChunkMesh, ClientLevel } from "$/client/level/client_level.ts"; -import { profiler } from "$/client/profiler.ts"; -import { Camera } from "$/client/camera.ts"; -import { AssetManager } from "$/client/assets.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; -import type { MultiPlayerGameMode } from "$/client/game_mode.ts"; -import type { Entity } from "$/client/entity/entity.ts"; -import { RemotePlayer } from "$/client/entity/remote_player.ts"; -import { ItemEntity } from "$/client/entity/item_entity.ts"; +import { type Chunk, CHUNK_SIZE, type ChunkMesh, ClientLevel } from "@/client/level/client_level.ts"; +import { profiler } from "@/client/profiler.ts"; +import { Camera } from "@/client/camera.ts"; +import { AssetManager } from "@/client/assets.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; +import type { MultiPlayerGameMode } from "@/client/game_mode.ts"; +import type { Entity } from "@/client/entity/entity.ts"; +import { RemotePlayer } from "@/client/entity/remote_player.ts"; +import { ItemEntity } from "@/client/entity/item_entity.ts"; import { render_block_items, render_item_entity } from "./item_renderer.ts"; import { HURT_TINT, player_pose, render_player } from "./player_renderer.ts"; import { render_worn } from "./worn_renderer.ts"; @@ -17,7 +17,7 @@ import type { PlayerPose } from "./player_model.ts"; import type { Vec3 } from "./model_math.ts"; import { render_mod_entity } from "./entity_renderer.ts"; import { entity_tint } from "./entity_light.ts"; -import { RemoteEntity } from "$/client/entity/remote_entity.ts"; +import { RemoteEntity } from "@/client/entity/remote_entity.ts"; import { draw_terrain, flush_batch, @@ -28,14 +28,14 @@ import { use_texture, view_projection, white_tex, -} from "$/client/renderer/mod.ts"; -import { type BlockRegistry, EverythingRegistry, type RenderLayer } from "$/common/everything_registry.ts"; -import { bake_block, type BakedQuad, FACE_INDEX, looks_by_state, type ModelJson } from "$/common/block_models.ts"; -import { BREAK_STAGES, ID_MASK } from "$/common/constants.ts"; -import { type Shape, shape_at } from "$/common/block_shapes.ts"; -import type { BlockHitResult } from "$/client/level/client_level.ts"; -import { FACE_GROUPS, UNALIGNED_GROUP } from "$/client/workers/chunk_messages.ts"; -import { FACE_AXIS, FACE_NORMALS } from "$/client/workers/translucent_sort.ts"; +} from "@/client/renderer/mod.ts"; +import { type BlockRegistry, EverythingRegistry, type RenderLayer } from "@/common/everything_registry.ts"; +import { bake_block, type BakedQuad, FACE_INDEX, looks_by_state, type ModelJson } from "@/common/block_models.ts"; +import { BREAK_STAGES, ID_MASK } from "@/common/constants.ts"; +import { type Shape, shape_at } from "@/common/block_shapes.ts"; +import type { BlockHitResult } from "@/client/level/client_level.ts"; +import { FACE_GROUPS, UNALIGNED_GROUP } from "@/client/workers/chunk_messages.ts"; +import { FACE_AXIS, FACE_NORMALS } from "@/client/workers/translucent_sort.ts"; import { Frustum } from "./frustum.ts"; import { draw_visuals } from "./visuals.ts"; diff --git a/client/rendering/model_math.ts b/client/rendering/model_math.ts index e232873..5383047 100644 --- a/client/rendering/model_math.ts +++ b/client/rendering/model_math.ts @@ -3,7 +3,7 @@ // turning and moving the parts of models: entity models' bones, the player's parts and what's worn on them. no // drawing here, so tests can use it -import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts"; +import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts"; export type Vec3 = [number, number, number]; diff --git a/client/rendering/model_renderer.ts b/client/rendering/model_renderer.ts index 5f28862..df860c2 100644 --- a/client/rendering/model_renderer.ts +++ b/client/rendering/model_renderer.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // entity models' boxes, for mod entities and for what players wear. the atlas has to be the current texture -import type { Texture } from "$/client/renderer/mod.ts"; -import type { SpriteRegion } from "$/common/constants.ts"; -import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts"; +import type { Texture } from "@/client/renderer/mod.ts"; +import type { SpriteRegion } from "@/common/constants.ts"; +import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts"; import { apply, bone_matrices, type Matrix, type Vec3 } from "./model_math.ts"; import { push_box, type VertexSink } from "./player_renderer.ts"; diff --git a/client/rendering/nameplate_renderer.ts b/client/rendering/nameplate_renderer.ts index 322b79b..0196a67 100644 --- a/client/rendering/nameplate_renderer.ts +++ b/client/rendering/nameplate_renderer.ts @@ -1,11 +1,11 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { Camera } from "$/client/camera.ts"; -import type { Entity } from "$/client/entity/entity.ts"; -import type { ClientLevel } from "$/client/level/client_level.ts"; -import { RemotePlayer } from "$/client/entity/remote_player.ts"; -import { draw_rect_3d, draw_text_3d, flush_batch, measure_text, type Plane3d } from "$/client/renderer/mod.ts"; +import type { Camera } from "@/client/camera.ts"; +import type { Entity } from "@/client/entity/entity.ts"; +import type { ClientLevel } from "@/client/level/client_level.ts"; +import { RemotePlayer } from "@/client/entity/remote_player.ts"; +import { draw_rect_3d, draw_text_3d, flush_batch, measure_text, type Plane3d } from "@/client/renderer/mod.ts"; // how big a font pixel is, in blocks. m6x11's letters are 11 pixels tall, so about a quarter of a block const SCALE = 0.022; diff --git a/client/rendering/player_model.ts b/client/rendering/player_model.ts index 7960ac4..1a469a1 100644 --- a/client/rendering/player_model.ts +++ b/client/rendering/player_model.ts @@ -3,9 +3,9 @@ // minecraft's player model and how it's posed each frame, for drawing players and what they wear. no drawing here, so // tests can use it -import { PLAYER_HEIGHT, PLAYER_SWIM_HEIGHT } from "$/common/constants.ts"; -import { PLAYER_PARTS, type WornProperties } from "$/common/everything_registry.ts"; -import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts"; +import { PLAYER_HEIGHT, PLAYER_SWIM_HEIGHT } from "@/common/constants.ts"; +import { PLAYER_PARTS, type WornProperties } from "@/common/everything_registry.ts"; +import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts"; import { apply, IDENTITY, type Matrix, multiply, rotation_around, type Vec3 } from "./model_math.ts"; export type PartName = typeof PLAYER_PARTS[number]; diff --git a/client/rendering/player_renderer.ts b/client/rendering/player_renderer.ts index 36efcd8..0170c1b 100644 --- a/client/rendering/player_renderer.ts +++ b/client/rendering/player_renderer.ts @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { Player } from "$/client/entity/player.ts"; -import { push_vertex, type Texture } from "$/client/renderer/mod.ts"; +import type { Player } from "@/client/entity/player.ts"; +import { push_vertex, type Texture } from "@/client/renderer/mod.ts"; import type { Vec3 } from "./model_math.ts"; import { type ModelPart, diff --git a/client/rendering/render_utils.ts b/client/rendering/render_utils.ts index d414225..a1506a6 100644 --- a/client/rendering/render_utils.ts +++ b/client/rendering/render_utils.ts @@ -2,20 +2,20 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { mat4, vec3 } from "gl-matrix"; -import { SLOT_SIZE } from "$/common/constants.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; -import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; -import { AssetManager } from "$/client/assets.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import type { FluidVariant } from "$/common/mod_api/shared.ts"; -import { item_texture } from "$/common/utils.ts"; +import { SLOT_SIZE } from "@/common/constants.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; +import { BlockRegistry, EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; +import { AssetManager } from "@/client/assets.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import type { FluidVariant } from "@/common/mod_api/shared.ts"; +import { item_texture } from "@/common/utils.ts"; import { cube_face_texture, cube_face_tint, type DisplayTransform, ITEM_FACE_SHADE, item_tint, -} from "$/common/block_models.ts"; +} from "@/common/block_models.ts"; import { display_matrix, fluid_look, @@ -34,7 +34,7 @@ import { push_vertex, Texture, use_texture, -} from "$/client/renderer/mod.ts"; +} from "@/client/renderer/mod.ts"; // the corners keep their size (times scale), the edges stretch along and the middle fills the rest, like minecraft's // nine slice gui sprites. borders are in source pixels diff --git a/client/rendering/visuals.ts b/client/rendering/visuals.ts index cd5dd39..190d918 100644 --- a/client/rendering/visuals.ts +++ b/client/rendering/visuals.ts @@ -16,8 +16,8 @@ import type { TransformedInstance, Visual, VisualBlock, -} from "$/common/mod_api/client.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; +} from "@/common/mod_api/client.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; import { bake_block, bake_model, @@ -27,11 +27,11 @@ import { type ModelElementJson, type ModelJson, states_of, -} from "$/common/block_models.ts"; -import { CHUNK_AREA, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts"; -import type { ModelFace } from "$/common/mod_data.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import { chunk_key, item_texture } from "$/common/utils.ts"; +} from "@/common/block_models.ts"; +import { CHUNK_AREA, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts"; +import type { ModelFace } from "@/common/mod_data.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { chunk_key, item_texture } from "@/common/utils.ts"; import { create_vertex_buffer, destroy_buffer, @@ -40,8 +40,8 @@ import { MODEL_VERTEX_BYTES, type Texture, write_buffer, -} from "$/client/renderer/mod.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; +} from "@/client/renderer/mod.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; import { fluid_look, ground_transform, item_layers, push_item, sprite_u, sprite_v } from "./item_renderer.ts"; export interface VisualRegistration { diff --git a/client/rendering/worn_renderer.ts b/client/rendering/worn_renderer.ts index 6b3e181..9f6533c 100644 --- a/client/rendering/worn_renderer.ts +++ b/client/rendering/worn_renderer.ts @@ -4,13 +4,13 @@ // what players wear, like curios' render layer: each worn item's model (see WornProperties) on the player, its bones // named like the player's parts turned the way those parts are, so it moves with them like minecraft's // TransformCopyingHumanoidModel. see docs/modding/items/index.md -import { AssetManager } from "$/client/assets.ts"; -import type { Player } from "$/client/entity/player.ts"; -import type { ItemStack } from "$/common/inventory.ts"; -import type { Texture } from "$/client/renderer/mod.ts"; -import { get_sprite_region } from "$/client/sprites.ts"; -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts"; +import { AssetManager } from "@/client/assets.ts"; +import type { Player } from "@/client/entity/player.ts"; +import type { ItemStack } from "@/common/inventory.ts"; +import type { Texture } from "@/client/renderer/mod.ts"; +import { get_sprite_region } from "@/client/sprites.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts"; import { IDENTITY, type Vec3 } from "./model_math.ts"; import { push_model } from "./model_renderer.ts"; import type { VertexSink } from "./player_renderer.ts"; diff --git a/client/sprites.ts b/client/sprites.ts index 35e8074..53fce3a 100644 --- a/client/sprites.ts +++ b/client/sprites.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { type SpriteRegion, TEXTURE_SIZE } from "$/common/constants.ts"; +import { type SpriteRegion, TEXTURE_SIZE } from "@/common/constants.ts"; import { AssetManager } from "./assets.ts"; type TexturesInfo = Record; diff --git a/client/texture_animations.ts b/client/texture_animations.ts index 13d83df..b0a96c1 100644 --- a/client/texture_animations.ts +++ b/client/texture_animations.ts @@ -3,8 +3,8 @@ // animated textures play like minecraft's: the atlas holds one frame of each, and every tick the ones whose frame // changed copy the new frame's pixels over it. models never change, only the atlas does -import type { SpriteRegion } from "$/common/constants.ts"; -import type { Animation } from "$/common/texture_animation.ts"; +import type { SpriteRegion } from "@/common/constants.ts"; +import type { Animation } from "@/common/texture_animation.ts"; // pixels to copy into a texture's place in the atlas: frame_width × frame_height of them, starting at offset bytes // into data, rows bytes_per_row apart diff --git a/client/workers/chunk_messages.ts b/client/workers/chunk_messages.ts index 3fcffd8..dcc2e25 100644 --- a/client/workers/chunk_messages.ts +++ b/client/workers/chunk_messages.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { BlockRegistry } from "$/common/everything_registry.ts"; -import type { SpriteRegion } from "$/common/constants.ts"; -import type { ModelJson } from "$/common/block_models.ts"; +import type { BlockRegistry } from "@/common/everything_registry.ts"; +import type { SpriteRegion } from "@/common/constants.ts"; +import type { ModelJson } from "@/common/block_models.ts"; import type { SortType } from "./translucent_sort.ts"; // messages between the main thread and the chunk workers diff --git a/client/workers/chunk_worker.ts b/client/workers/chunk_worker.ts index b055fee..6d2e19e 100644 --- a/client/workers/chunk_worker.ts +++ b/client/workers/chunk_worker.ts @@ -8,7 +8,7 @@ import { block_light_opacity, type BlockRegistry, type RenderLayer, -} from "$/common/everything_registry.ts"; +} from "@/common/everything_registry.ts"; import { AIR, CHUNK_AREA, @@ -17,7 +17,7 @@ import { ID_MASK, type SpriteRegion, TEXTURE_SIZE, -} from "$/common/constants.ts"; +} from "@/common/constants.ts"; import type { Texture } from "../renderer/types.ts"; import { FACE_GROUPS, @@ -35,7 +35,7 @@ import { is_tinted, looks_by_state, type ModelJson, -} from "$/common/block_models.ts"; +} from "@/common/block_models.ts"; import { choose_sort_type, FACE_AXIS, @@ -56,7 +56,7 @@ import { REGION_VOID, } from "./lighting.ts"; import { cell_index, fluid_quads, type FluidCell } from "./fluid_mesh.ts"; -import { fluid_height, fluid_textures } from "$/common/everything_registry.ts"; +import { fluid_height, fluid_textures } from "@/common/everything_registry.ts"; type TexturesInfo = Record; diff --git a/client/workers/fluid_mesh.ts b/client/workers/fluid_mesh.ts index 9d39dd0..aea96bc 100644 --- a/client/workers/fluid_mesh.ts +++ b/client/workers/fluid_mesh.ts @@ -4,7 +4,7 @@ // fluids drawn like luanti's flowing fluids (MapblockMeshGenerator::drawLiquidNode in its content_mapblock.cpp): each // corner of the surface is as high as the fluid around it, so it slopes down where it flows away from a source. the // sides between two cells of it are left out, except where it pours down past the surface of the one beside it -import { FACE_CORNERS } from "$/common/block_models.ts"; +import { FACE_CORNERS } from "@/common/block_models.ts"; // one of the 3x3 cells around a fluid and level with it, and the cell above that one export interface FluidCell { diff --git a/client/workers/lighting.ts b/client/workers/lighting.ts index 3301257..4275e1b 100644 --- a/client/workers/lighting.ts +++ b/client/workers/lighting.ts @@ -10,7 +10,7 @@ // 3x3 chunks around the chunk being meshed, which gives the same result: light reaches at most 15 // blocks, so nothing outside those chunks can light the middle one or its border -import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts"; +import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts"; export const REGION_SIZE = CHUNK_SIZE * 3; export const REGION_LAYER = REGION_SIZE * REGION_SIZE; diff --git a/common/bmod.ts b/common/bmod.ts index 0922e69..c94ebf0 100644 --- a/common/bmod.ts +++ b/common/bmod.ts @@ -238,9 +238,9 @@ export function read_bmod(bytes: Uint8Array, file: string): Bmod { scripts[side as ScriptSide] = code; } } - // what the bworld/engine shim reads, so it's in the bundle of every script that imports it + // what the cubi/engine shim reads, so it's in the bundle of every script that imports it if (!manifest.engine_access && Object.values(scripts).some((code) => code.includes(ENGINE_GLOBAL))) { - problems.push(`a script uses bworld/engine, which needs "engine_access": true in manifest.json`); + problems.push(`a script uses cubi/engine, which needs "engine_access": true in manifest.json`); } const credits = manifest.credits === undefined ? undefined : text(manifest.credits); if (manifest.credits !== undefined && credits === undefined) { diff --git a/common/generation.ts b/common/generation.ts index c4511ff..27afd32 100644 --- a/common/generation.ts +++ b/common/generation.ts @@ -4,9 +4,9 @@ // generating a chunk: the terrain from the generator's data (common/worldgen), then ores, then mods' features. // only the server generates, players get finished chunks import { Alea } from "@paulaboks/rng"; -import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts"; -import type { FeatureChunk, Position } from "$/common/mod_api/worldgen.ts"; -import type { OreJson } from "$/common/mod_data.ts"; +import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts"; +import type { FeatureChunk, Position } from "@/common/mod_api/worldgen.ts"; +import type { OreJson } from "@/common/mod_data.ts"; import { generate_overworld } from "./worldgen/overworld.ts"; import type { Generator } from "./worldgen/generator.ts"; import { named_noise_2d, named_noise_3d } from "./worldgen/noise.ts"; diff --git a/common/hooks.ts b/common/hooks.ts index 5f64f45..893b3e6 100644 --- a/common/hooks.ts +++ b/common/hooks.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -// engine access: hooks on the engine's own methods, like neoforge's mixins, and the global the bworld/engine shim reads. +// engine access: hooks on the engine's own methods, like neoforge's mixins, and the global the cubi/engine shim reads. // see docs/modding/misc/engine.md and docs/modding_plan.md import { GAME_VERSION } from "./constants.ts"; @@ -199,7 +199,7 @@ export function clear_hooks() { hooked.clear(); } -// runs fn as the mod: hook knows whose hooks it makes, and bworld/engine refuses mods without engine_access +// runs fn as the mod: hook knows whose hooks it makes, and cubi/engine refuses mods without engine_access export async function loading_mod(mod: string, engine_access: boolean, fn: () => Promise): Promise { const previous = loading; loading = { mod, engine_access }; @@ -217,7 +217,7 @@ export interface EngineModules { client?: Record; } -// what bworld/engine reads, see common/mod_api/engine.ts +// what cubi/engine reads, see common/mod_api/engine.ts export interface EngineGlobal { version: string; engine: EngineModules; @@ -226,9 +226,9 @@ export interface EngineGlobal { check_access(): void; } -export const ENGINE_GLOBAL = "__bworld_engine"; +export const ENGINE_GLOBAL = "__cubi_engine"; -// puts a side's modules where bworld/engine finds them. a realm with the server and a client in it, like tests, gets +// puts a side's modules where cubi/engine finds them. a realm with the server and a client in it, like tests, gets // both export function expose_engine(modules: EngineModules) { const global = globalThis as unknown as Record; @@ -242,9 +242,9 @@ export function expose_engine(modules: EngineModules) { engine: { ...modules }, hook, check_access() { - if (!loading) throw new Error("bworld/engine can only be imported by a mod's script"); + if (!loading) throw new Error("cubi/engine can only be imported by a mod's script"); if (!loading.engine_access) { - throw new Error(`${loading.mod} imports bworld/engine without "engine_access" in its manifest`); + throw new Error(`${loading.mod} imports cubi/engine without "engine_access" in its manifest`); } }, }; diff --git a/common/inventory.ts b/common/inventory.ts index c4e7990..aff1aca 100644 --- a/common/inventory.ts +++ b/common/inventory.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; +import { EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; import type { FluidRules } from "./fluids.ts"; import type { FluidVariant } from "./mod_api/shared.ts"; import { is_object } from "./schema.ts"; diff --git a/common/mod_api/client.ts b/common/mod_api/client.ts index ce9ae79..9f05c71 100644 --- a/common/mod_api/client.ts +++ b/common/mod_api/client.ts @@ -125,7 +125,7 @@ export interface VisualBlock { readonly z: number; // they stay the same for the visual's life, it's made again when they change readonly states: Readonly>; - // a field of its client data now, a copy, see BlockRef.set_client_data in bworld/server + // a field of its client data now, a copy, see BlockRef.set_client_data in cubi/server get_client_data(field: string): T | undefined; } diff --git a/common/mod_api/engine.ts b/common/mod_api/engine.ts index c2486f1..c9c6d53 100644 --- a/common/mod_api/engine.ts +++ b/common/mod_api/engine.ts @@ -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; } -const api = (globalThis as unknown as Record)["__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)["__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; diff --git a/common/mod_api/server.ts b/common/mod_api/server.ts index 8ddd498..b628660 100644 --- a/common/mod_api/server.ts +++ b/common/mod_api/server.ts @@ -118,7 +118,7 @@ export interface BlockComponent

{ // particular when it's undefined, like neoforge's Capabilities.FluidHandler.BLOCK. undefined when it has none // there. see ServerFluidApi.block_handler fluid_handler?(block: BlockRef, params: P, face: Face | undefined): FluidHandler | undefined; - // placing and neighbor rules are in shared scripts, see BlockRules in bworld/shared + // placing and neighbor rules are in shared scripts, see BlockRules in cubi/shared } // deno-lint-ignore no-explicit-any diff --git a/common/mod_data.ts b/common/mod_data.ts index 5404f99..a22e578 100644 --- a/common/mod_data.ts +++ b/common/mod_data.ts @@ -79,7 +79,7 @@ const manifest_schema = (folder_name: string) => version: z.string("must be semver, like 1.0.0").regex(/^\d+\.\d+\.\d+/), authors: z.array(z.string()).optional(), game_version: z.string().optional(), - // imports bworld/engine to reach into the engine and hook its methods. needs game_version within one minor version + // imports cubi/engine to reach into the engine and hook its methods. needs game_version within one minor version engine_access: z.boolean().optional(), dependencies: z.array(z.object({ id: z.string(), version: z.string() })).optional(), scripts: z.strictObject({ diff --git a/common/mod_loader.ts b/common/mod_loader.ts index ee3040f..c1b9cbc 100644 --- a/common/mod_loader.ts +++ b/common/mod_loader.ts @@ -83,7 +83,7 @@ export interface ModListing { // where it's served from, relative to the server's root. named by its hash, so it never changes file: string; size: number; - // it imports bworld/engine, see docs/modding/misc/engine.md. the confirm screen for other sites says so + // it imports cubi/engine, see docs/modding/misc/engine.md. the confirm screen for other sites says so engine_access?: boolean; } diff --git a/common/worldgen/overworld.ts b/common/worldgen/overworld.ts index afe188b..411eeeb 100644 --- a/common/worldgen/overworld.ts +++ b/common/worldgen/overworld.ts @@ -5,7 +5,7 @@ // noise cells), caves cut out of it, then each column's biome, its surface blocks and fluids. what all of it is comes // from the generator's noise settings, see OverworldTerrain and docs/modding/worldgen/terrain.md. trees and the rest // are features, after it -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; import { get_biome } from "./biomes.ts"; import type { OverworldTerrain, TerrainColumn } from "./terrain.ts"; import { diff --git a/common/worldgen_loader.ts b/common/worldgen_loader.ts index cde074c..0268671 100644 --- a/common/worldgen_loader.ts +++ b/common/worldgen_loader.ts @@ -3,8 +3,8 @@ // imports mods' worldgen scripts and collects what they and mods' data add to generation: the generator, ores, and // features, code and data, in the order they run. used by the game server -import type { FeatureBiome, FeatureChunk, FeatureStep, WorldgenContext } from "$/common/mod_api/worldgen.ts"; -import type { OreJson } from "$/common/mod_data.ts"; +import type { FeatureBiome, FeatureChunk, FeatureStep, WorldgenContext } from "@/common/mod_api/worldgen.ts"; +import type { OreJson } from "@/common/mod_data.ts"; import type { SetupFeature, WorldgenSetup } from "./generation.ts"; import { EverythingRegistry } from "./everything_registry.ts"; import { ModLoadError } from "./mod_loader.ts"; diff --git a/deno.json b/deno.json index 64a6403..8d09579 100644 --- a/deno.json +++ b/deno.json @@ -24,12 +24,12 @@ "exclude": ["desktop/*.md"] }, "imports": { - "$/": "./", - "bworld/server": "./common/mod_api/server.ts", - "bworld/client": "./common/mod_api/client.ts", - "bworld/worldgen": "./common/mod_api/worldgen.ts", - "bworld/shared": "./common/mod_api/shared.ts", - "bworld/engine": "./common/mod_api/engine.ts", + "@/": "./", + "cubi/server": "./common/mod_api/server.ts", + "cubi/client": "./common/mod_api/client.ts", + "cubi/worldgen": "./common/mod_api/worldgen.ts", + "cubi/shared": "./common/mod_api/shared.ts", + "cubi/engine": "./common/mod_api/engine.ts", "@gfx/canvas-wasm": "jsr:@gfx/canvas-wasm@^0.4.2", "@paulaboks/rng": "jsr:@paulaboks/rng@^0.0.3", "@std/assert": "jsr:@std/assert@^1.0.0", diff --git a/docs/modding/blocks/components.md b/docs/modding/blocks/components.md index 2df34a7..ab5baa0 100644 --- a/docs/modding/blocks/components.md +++ b/docs/modding/blocks/components.md @@ -23,7 +23,7 @@ A block can list several. Their handlers run in the listed order. In the server script: ```ts -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; interface OxidizesParams { seconds: number; @@ -150,7 +150,7 @@ run them too: that's how a player sees a fence join its neighbors the moment the when the server answers. A component can have rules, handlers, or both, and a block can list one that only has rules. ```ts -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export function setup(ctx: SharedContext) { ctx.components.register_block("copper_tools:pipe", { diff --git a/docs/modding/blocks/visuals.md b/docs/modding/blocks/visuals.md index a1d823a..a8278f6 100644 --- a/docs/modding/blocks/visuals.md +++ b/docs/modding/blocks/visuals.md @@ -8,7 +8,7 @@ draws its machines with. ## Registering ```ts -import type { ClientContext } from "bworld/client"; +import type { ClientContext } from "cubi/client"; export function setup(ctx: ClientContext) { ctx.render.register_visual("copper_tools:shaft", (block, instances) => { diff --git a/docs/modding/concepts/events.md b/docs/modding/concepts/events.md index e2e9a65..4c76cad 100644 --- a/docs/modding/concepts/events.md +++ b/docs/modding/concepts/events.md @@ -13,7 +13,7 @@ Every event is a signal you subscribe to. Events come in two kinds: - **After events** fire once it has happened. They're for reacting, and can't change anything. ```ts -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { // nobody breaks blocks within 16 blocks of the world's center diff --git a/docs/modding/concepts/sides.md b/docs/modding/concepts/sides.md index a72208e..9347b21 100644 --- a/docs/modding/concepts/sides.md +++ b/docs/modding/concepts/sides.md @@ -46,7 +46,7 @@ on every client, before any script runs. See [Registries](registries.md). ### Server Scripts ```ts -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { // register components and commands, subscribe to events @@ -64,7 +64,7 @@ world, through [tile data](../blocks/tiledata.md), [containers](../inventories/c ### Client Scripts ```ts -import type { ClientContext } from "bworld/client"; +import type { ClientContext } from "cubi/client"; export function setup(ctx: ClientContext) { ctx.ui.add_inventory_overlay({ on_render(g, screen) {/* ... */} }); @@ -81,7 +81,7 @@ Client code is visible to players and can be changed by them. Never trust it for ### Shared Scripts ```ts -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export function setup(ctx: SharedContext) { ctx.components.register_block("copper_tools:pipe", { diff --git a/docs/modding/entities/effects.md b/docs/modding/entities/effects.md index 7f5a048..bf816d4 100644 --- a/docs/modding/entities/effects.md +++ b/docs/modding/entities/effects.md @@ -48,7 +48,7 @@ An effect that does something each tick lists components, with their parameters: The server script registers them during `setup`, in the mod's own namespace: ```ts -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { ctx.components.register_effect<{ every: number }>("copper_tools:rusting", { diff --git a/docs/modding/gettingstarted/modfiles.md b/docs/modding/gettingstarted/modfiles.md index 6ba04a8..fbe7df4 100644 --- a/docs/modding/gettingstarted/modfiles.md +++ b/docs/modding/gettingstarted/modfiles.md @@ -81,7 +81,7 @@ matter, the `id` inside does, except for [tags](../resources/tags.md), whose id | `version` | yes | The mod's own version, semver like `1.0.0`. | | `authors` | no | A list of names. | | `game_version` | no | The bworld versions the mod works with, as a semver range. Only checked for mods with `engine_access`. | -| `engine_access` | no | `true` lets the scripts import `bworld/engine` and hook the engine. See [Engine Access](../misc/engine.md). | +| `engine_access` | no | `true` lets the scripts import `cubi/engine` and hook the engine. See [Engine Access](../misc/engine.md). | | `dependencies` | no | Other mods, `{ "id", "version" }`. A missing dependency is an error, and dependencies load first. The version range isn't checked yet. | | `scripts` | no | Paths to the `server`, `client`, `shared` and `worldgen` scripts. See [Sides](../concepts/sides.md). | | `credits` | no | A markdown file for licenses and thanks, shown on the Credits screen. Raw HTML in it is shown as text. | @@ -102,11 +102,11 @@ so they can import other files and packages, but code imported by several script When a mod's folder has a `deno.json`, its scripts are bundled and typechecked with it, so the mod can have its own imports and npm or JSR packages. Mods without one use the `deno.json` of the folder the build runs in, like the mods in -this repository. That config maps the API types, which scripts import as `bworld/server`, `bworld/client`, -`bworld/shared` and `bworld/worldgen`, and [`bworld/engine`](../misc/engine.md): +this repository. That config maps the API types, which scripts import as `cubi/server`, `cubi/client`, `cubi/shared` and +`cubi/worldgen`, and [`cubi/engine`](../misc/engine.md): ```ts -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; ``` ## `.bmod` Files diff --git a/docs/modding/gui/index.md b/docs/modding/gui/index.md index 15eb202..bcd7822 100644 --- a/docs/modding/gui/index.md +++ b/docs/modding/gui/index.md @@ -53,7 +53,7 @@ the screen, like Just Enough Items' item list. A menu screen with `inventory_ove game's fishing minigame. `mods/recipe_viewer` is one. ```ts -import type { ClientContext } from "bworld/client"; +import type { ClientContext } from "cubi/client"; export function setup(ctx: ClientContext) { ctx.ui.add_inventory_overlay({ diff --git a/docs/modding/misc/commands.md b/docs/modding/misc/commands.md index 55f3b45..5a4f849 100644 --- a/docs/modding/misc/commands.md +++ b/docs/modding/misc/commands.md @@ -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; diff --git a/docs/modding/misc/config.md b/docs/modding/misc/config.md index ff7174e..8798c21 100644 --- a/docs/modding/misc/config.md +++ b/docs/modding/misc/config.md @@ -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; diff --git a/docs/modding/misc/engine.md b/docs/modding/misc/engine.md index 329c9af..a47fec7 100644 --- a/docs/modding/misc/engine.md +++ b/docs/modding/misc/engine.md @@ -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. diff --git a/docs/modding/resources/fluids.md b/docs/modding/resources/fluids.md index 2214613..30c52a9 100644 --- a/docs/modding/resources/fluids.md +++ b/docs/modding/resources/fluids.md @@ -52,7 +52,7 @@ A fluid's name, color and value can depend on its data. The mod's [shared script gives one of its fluids rules for that, like NeoForge's `FluidType.getDescription` and `FluidTintSource.colorAsStack`: ```ts -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; interface SyrupData { tree?: string; diff --git a/docs/modding/resources/loot_tables.md b/docs/modding/resources/loot_tables.md index 4ec117d..6d729bf 100644 --- a/docs/modding/resources/loot_tables.md +++ b/docs/modding/resources/loot_tables.md @@ -177,7 +177,7 @@ Those become the `bworld:season`, `bworld:biome` and `bworld:time` conditions, w Server scripts roll tables, fill containers, and add conditions, functions and changes of their own: ```ts -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { // "condition": "my_mod:night" in any table diff --git a/docs/modding/resources/recipes.md b/docs/modding/resources/recipes.md index c73d534..46be52b 100644 --- a/docs/modding/resources/recipes.md +++ b/docs/modding/resources/recipes.md @@ -166,7 +166,7 @@ recipes. What their fields mean is up to the mod, which registers the type from [shared script](../concepts/sides.md#shared-scripts), like NeoForge's `RecipeType` with its serializer: ```ts -import type { ItemStack, SharedContext } from "bworld/shared"; +import type { ItemStack, SharedContext } from "cubi/shared"; interface SmithingRecipe { tool: string; @@ -228,7 +228,7 @@ A recipe that follows from other data, like one for every item with a component, adds one like a file in `recipes/` with that `type` would, with the rest of its fields from `json`: ```ts -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export function setup(ctx: SharedContext) { // a sieve recipe for every item that says what it sifts into diff --git a/docs/modding/worldgen/biomes.md b/docs/modding/worldgen/biomes.md index 1040abd..ad1b527 100644 --- a/docs/modding/worldgen/biomes.md +++ b/docs/modding/worldgen/biomes.md @@ -115,4 +115,4 @@ ctx.components.register_block("my_mod:crop", { }); ``` -`Season` is exported from `bworld/server`, `bworld/client` and `bworld/shared`. +`Season` is exported from `cubi/server`, `cubi/client` and `cubi/shared`. diff --git a/docs/modding/worldgen/index.md b/docs/modding/worldgen/index.md index 9afdf06..7f3eb1f 100644 --- a/docs/modding/worldgen/index.md +++ b/docs/modding/worldgen/index.md @@ -77,7 +77,7 @@ order they were registered. The base game's trees are in `vegetal_decoration`, s The worldgen script registers them: ```ts -import type { WorldgenContext } from "bworld/worldgen"; +import type { WorldgenContext } from "cubi/worldgen"; export function setup(gen: WorldgenContext) { gen.register_feature("copper_tools:boulders", (chunk) => { diff --git a/docs/modding_plan.md b/docs/modding_plan.md index 53d0380..dd6ead0 100644 --- a/docs/modding_plan.md +++ b/docs/modding_plan.md @@ -15,11 +15,11 @@ bworld's modding takes from three places: A mod is built from up to three layers. Most mods only need the first one or two: -| Layer | Like | What a mod writes | Stability | -| ----------------- | ---------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------- | -| **Data** | Bedrock behavior packs | JSON in `blocks/`, `items/`, `models/`, `recipes/`, ... | Versioned by `format_version` | -| **Game API** | Minetest's Lua API, Bedrock's Script API | TypeScript against `bworld/server`, `bworld/client`, `bworld/worldgen` | Only breaks with the game's major version | -| **Engine access** | NeoForge's mixins | `import { engine, hook } from "bworld/engine"` | None, tied to one game version | +| Layer | Like | What a mod writes | Stability | +| ----------------- | ---------------------------------------- | ---------------------------------------------------------------- | ----------------------------------------- | +| **Data** | Bedrock behavior packs | JSON in `blocks/`, `items/`, `models/`, `recipes/`, ... | Versioned by `format_version` | +| **Game API** | Minetest's Lua API, Bedrock's Script API | TypeScript against `cubi/server`, `cubi/client`, `cubi/worldgen` | Only breaks with the game's major version | +| **Engine access** | NeoForge's mixins | `import { engine, hook } from "cubi/engine"` | None, tied to one game version | ## Status @@ -43,15 +43,15 @@ The code is in `common/mod_loader.ts`, `common/mod_data.ts`, `common/mod_check.t **Not built at all:** common scripts, the registry freeze and hash, overrides. -**Engine access** is built (phase 3): `bworld/engine`, `hook`, `engine_access` and its checks, and `physics` as the -first plain object mods can hook. See [Engine Access](modding/misc/engine.md). The code is in `common/hooks.ts`, +**Engine access** is built (phase 3): `cubi/engine`, `hook`, `engine_access` and its checks, and `physics` as the first +plain object mods can hook. See [Engine Access](modding/misc/engine.md). The code is in `common/hooks.ts`, `common/mod_api/engine.ts` and the `engine_modules.ts` of each side. **Known gaps:** - Manifest `dependencies` version ranges aren't checked, and `game_version` only is for engine access mods. - Mods can't throw a `CommandError` the server recognizes: it's checked with `instanceof`, and the class isn't in the - API, so a mod's bundled copy is a different class. Export it from `bworld/server`, or recognize it by `name`. + API, so a mod's bundled copy is a different class. Export it from `cubi/server`, or recognize it by `name`. - Tools only lose durability when their owner dies. Nothing else uses it. - The GUI scale is always 3: screens work in GUI pixels like NeoForge's, but there's no option to change it yet. - Worn models haven't been looked at in the game yet, only tested: Artifacts' power glove and feral claws and the giant @@ -170,7 +170,7 @@ asks for it in its manifest: ```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", { @@ -196,8 +196,8 @@ function hook(target: T, method: K, handlers: { ``` - `engine` holds the live modules on each side: `engine.common` everywhere, `engine.server` in server scripts, - `engine.client` in client scripts. The engine puts them on the global object at startup, and `bworld/engine` in a - mod's bundle is a shim that reads them, so a hook on a prototype changes every instance already made. + `engine.client` in client scripts. The engine puts them on the global object at startup, and `cubi/engine` in a mod's + bundle is a shim that reads them, so a hook on a prototype changes every instance already made. - Types are the engine's own source, so `check-mods` typechecks against exactly the engine the mod will run on. - Several mods can hook one method: `before` hooks run in priority order, `replace` hooks nest, `after` hooks chain results. A hook that throws is logged under its mod and skipped. @@ -210,7 +210,7 @@ function hook(target: T, method: K, handlers: { - Hooks reach one JavaScript realm. Chunk workers run their own copy of the engine, so a client hook doesn't change meshing. - It isn't a stable API. A mod with `engine_access` must set `game_version` within one minor version, and loading it on - another is a load error. Without `engine_access`, importing `bworld/engine` is an error. + another is a load error. Without `engine_access`, importing `cubi/engine` is an error. - A server mod with engine access controls the game worker completely, but the worker still has no Deno permissions. The confirm screen for other sites lists which mods use it. - Prefer the Game API. Many mods hooking the same thing is a sign it should become part of the Game API. @@ -340,7 +340,7 @@ server and a client end up with equal registries and hashes. `check-mods` rules. Check: a test mod adds a component to `bworld:grass_block`, changes `bworld:glass`'s toughness and replaces the chest recipe, on both sides and in the hash. -**Phase 3: engine access.** The global engine modules and the `bworld/engine` shim, `hook`, `engine_access` in the +**Phase 3: engine access.** The global engine modules and the `cubi/engine` shim, `hook`, `engine_access` in the manifest and its checks, and making the engine hookable where mods will want it. Check: test mods hook a server, a client and a worldgen method, hooks on one method run in priority order, and a throwing hook is logged without breaking the game. diff --git a/mods/bworld/scripts/client.ts b/mods/bworld/scripts/client.ts index 3a67407..b47db26 100644 --- a/mods/bworld/scripts/client.ts +++ b/mods/bworld/scripts/client.ts @@ -16,7 +16,7 @@ import type { MenuScreen, Visual, VisualBlock, -} from "bworld/client"; +} from "cubi/client"; import { MINIGAMES } from "./minigames/mod.ts"; import { JUICER_CAPACITY, JUICER_PRESSES } from "./shared.ts"; import { STONECUTTING, stonecutting_options, type StonecuttingRecipe } from "./stonecutting.ts"; diff --git a/mods/bworld/scripts/cooking.ts b/mods/bworld/scripts/cooking.ts index 7bc3064..7a88e89 100644 --- a/mods/bworld/scripts/cooking.ts +++ b/mods/bworld/scripts/cooking.ts @@ -6,7 +6,7 @@ // container the meal needs (a bowl), or straight out when it needs none. the cutting board, like its // CuttingBoardBlockEntity, holds a stack of anything and cuts it one at a time with the right tool -import type { BlockRef, Container, ItemStack, ServerContext } from "bworld/server"; +import type { BlockRef, Container, ItemStack, ServerContext } from "cubi/server"; import { COOKING, type CookingRecipe, CUTTING, type CuttingRecipe, INGREDIENT_SLOTS } from "./cooking_recipes.ts"; // stove diff --git a/mods/bworld/scripts/cooking_recipes.ts b/mods/bworld/scripts/cooking_recipes.ts index acffc52..7435d21 100644 --- a/mods/bworld/scripts/cooking_recipes.ts +++ b/mods/bworld/scripts/cooking_recipes.ts @@ -3,7 +3,7 @@ // the kitchen's recipe types, registered by the shared script: what the cooking pot cooks, found by the items in its // ingredient slots, and what the cutting board cuts, found by the item on it. see cooking.ts -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export const COOKING = "bworld:cooking"; export const CUTTING = "bworld:cutting"; diff --git a/mods/bworld/scripts/curios.ts b/mods/bworld/scripts/curios.ts index e455f7b..a29cdda 100644 --- a/mods/bworld/scripts/curios.ts +++ b/mods/bworld/scripts/curios.ts @@ -5,7 +5,7 @@ // a container of their own, and fall out when they die like the rest of what they carry. items with the // bworld:curio_modifiers component change the wearer's attributes, like curios' attribute modifiers, and ones with // bworld:curio_unhurt_effect give them an effect once they've gone a while without being hurt -import type { AttributeModifier, Container, ItemStack, Player, ServerContext, TagApi } from "bworld/server"; +import type { AttributeModifier, Container, ItemStack, Player, ServerContext, TagApi } from "cubi/server"; // where the left column of slots goes, from the inventory screen's left edge. the panel around them ends just left of it const COLUMNS_X = -45; diff --git a/mods/bworld/scripts/effects.ts b/mods/bworld/scripts/effects.ts index 54c7cba..0ca43dc 100644 --- a/mods/bworld/scripts/effects.ts +++ b/mods/bworld/scripts/effects.ts @@ -3,7 +3,7 @@ // what the base game's effects do over time, see mods/bworld/effects. speed and slowness are only attribute // modifiers, and resistance and water breathing work where damage and air happen, like minecraft's -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; // every n ticks, n halving with each level: minecraft's regeneration and poison function every(ticks: number, amplifier: number, n: number) { diff --git a/mods/bworld/scripts/fermenting.ts b/mods/bworld/scripts/fermenting.ts index 533045d..66dfc50 100644 --- a/mods/bworld/scripts/fermenting.ts +++ b/mods/bworld/scripts/fermenting.ts @@ -4,7 +4,7 @@ // fermentable recipes: a fluid that ferments into another over a number of ticks, like juice into wine in the keg. the // shared script registers one for every juice, and mods can add more like any recipe, as files or from their shared // scripts. they're found by the fluid that ferments -import type { FluidStack, FluidVariant, SharedContext } from "bworld/shared"; +import type { FluidStack, FluidVariant, SharedContext } from "cubi/shared"; import type { JuiceableParams } from "./shared.ts"; export const FERMENTABLE = "bworld:fermentable"; diff --git a/mods/bworld/scripts/fishing.ts b/mods/bworld/scripts/fishing.ts index 508582f..0fbdad5 100644 --- a/mods/bworld/scripts/fishing.ts +++ b/mods/bworld/scripts/fishing.ts @@ -4,8 +4,8 @@ // fishing, like minecraft's: right click with a rod to throw its hook forward. when it lands in a block with // bworld:fishable, like water, it floats there until something bites, and right clicking again before it gets away // reels it in. a hook that lands on anything else lies there until it's reeled in, with nothing on it -import type { EntityRef, ItemStack, Player, Season, ServerContext } from "bworld/server"; -import type { Position } from "bworld/shared"; +import type { EntityRef, ItemStack, Player, Season, ServerContext } from "cubi/server"; +import type { Position } from "cubi/shared"; import { MINIGAMES } from "./minigames/mod.ts"; const FISHING_ROD = "bworld:fishing_rod"; diff --git a/mods/bworld/scripts/juicing.ts b/mods/bworld/scripts/juicing.ts index e287e61..ad7f708 100644 --- a/mods/bworld/scripts/juicing.ts +++ b/mods/bworld/scripts/juicing.ts @@ -5,7 +5,7 @@ // bworld:juiceable, its own juice, and mods can add more like any recipe, as files or from their shared scripts. // whatever makes juice finds them by the item, like the juicer. with create installed, each is also a create:compacting // recipe, so its press can make juice in a basin -import type { FluidStack, SharedContext } from "bworld/shared"; +import type { FluidStack, SharedContext } from "cubi/shared"; import type { JuiceableParams } from "./shared.ts"; export const JUICING = "bworld:juicing"; diff --git a/mods/bworld/scripts/minigames/chess.ts b/mods/bworld/scripts/minigames/chess.ts index 1f3973b..ed0a609 100644 --- a/mods/bworld/scripts/minigames/chess.ts +++ b/mods/bworld/scripts/minigames/chess.ts @@ -3,7 +3,7 @@ // a lichess mate in one: the board after the opponent's move, and the player has SOLVE_TIME to play the mate. it's // all played on the screen, which says how it went: button 1 for the mate, 0 for any other move -import type { Color, Graphics } from "bworld/client"; +import type { Color, Graphics } from "cubi/client"; import { FishingMinigame, type MinigameArgs, type MinigameScreen, SOLVE_TIME, time_bar } from "./minigame.ts"; export class ChessMinigame extends FishingMinigame { diff --git a/mods/bworld/scripts/minigames/minigame.ts b/mods/bworld/scripts/minigames/minigame.ts index f4c9566..ede811f 100644 --- a/mods/bworld/scripts/minigames/minigame.ts +++ b/mods/bworld/scripts/minigames/minigame.ts @@ -3,8 +3,8 @@ // what every fishing minigame shares. each minigame is a file here with both its halves: a class the server builds // the minigame's menu with, and the screen client.ts draws it with. mod.ts lists them by name -import type { ItemStack, MenuBuilder, Player } from "bworld/server"; -import type { ClientMenu, Graphics, MenuScreen } from "bworld/client"; +import type { ItemStack, MenuBuilder, Player } from "cubi/server"; +import type { ClientMenu, Graphics, MenuScreen } from "cubi/client"; // how long the puzzle minigames give the player, the maze and chess, whatever the difficulty export const SOLVE_TIME = 8 * 20; diff --git a/mods/bworld/scripts/minigames/ring.ts b/mods/bworld/scripts/minigames/ring.ts index d3d07a8..039b21e 100644 --- a/mods/bworld/scripts/minigames/ring.ts +++ b/mods/bworld/scripts/minigames/ring.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { Color, Graphics } from "bworld/client"; +import type { Color, Graphics } from "cubi/client"; import { FishingMinigame, type MinigameArgs, type MinigameScreen } from "./minigame.ts"; // gray rings, and a thin green one growing out from the middle, faster the harder the fish is: like hold's bar diff --git a/mods/bworld/scripts/server.ts b/mods/bworld/scripts/server.ts index 82f42f7..8be1cc6 100644 --- a/mods/bworld/scripts/server.ts +++ b/mods/bworld/scripts/server.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // the base game's block and item behavior, written against the same api as any other mod -import type { BlockRef, Container, FluidHandler, FluidStack, Player, Season, ServerContext } from "bworld/server"; +import type { BlockRef, Container, FluidHandler, FluidStack, Player, Season, ServerContext } from "cubi/server"; import { register_curios } from "./curios.ts"; import { register_effects } from "./effects.ts"; import { register_fishing } from "./fishing.ts"; diff --git a/mods/bworld/scripts/shared.ts b/mods/bworld/scripts/shared.ts index 177f68c..475e1fe 100644 --- a/mods/bworld/scripts/shared.ts +++ b/mods/bworld/scripts/shared.ts @@ -5,7 +5,7 @@ // server and on every client, so players see a fence join or a trapdoor turn the moment they place it, and a trapdoor // or a door open the moment they click it. and the rules of juice and wine, which name and color them by the item // they're from, and the recipes that make them. and the base game's recipe types -import type { SharedBlock, SharedContext } from "bworld/shared"; +import type { SharedBlock, SharedContext } from "cubi/shared"; import { register_cooking_recipes } from "./cooking_recipes.ts"; import { register_fermenting } from "./fermenting.ts"; import { register_juicing } from "./juicing.ts"; diff --git a/mods/bworld/scripts/smelting.ts b/mods/bworld/scripts/smelting.ts index cd07c38..5f6ccde 100644 --- a/mods/bworld/scripts/smelting.ts +++ b/mods/bworld/scripts/smelting.ts @@ -3,7 +3,7 @@ // smelting and fuel recipes: the furnace cooks one item into another, burning fuel to do it. both are found by an item // id, and registered by the shared script like smithing.ts -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export const SMELTING = "bworld:smelting"; export const FUEL = "bworld:fuel"; diff --git a/mods/bworld/scripts/smithing.ts b/mods/bworld/scripts/smithing.ts index 13cce01..8c9cdef 100644 --- a/mods/bworld/scripts/smithing.ts +++ b/mods/bworld/scripts/smithing.ts @@ -3,7 +3,7 @@ // smithing recipes: the smithing table upgrades a tool with some of a material and maybe some of one more item. the // type is registered by the shared script, so the server's menu and anything on a client find them the same way -import type { ItemStack, SharedContext } from "bworld/shared"; +import type { ItemStack, SharedContext } from "cubi/shared"; export const SMITHING = "bworld:smithing"; diff --git a/mods/bworld/scripts/stonecutting.ts b/mods/bworld/scripts/stonecutting.ts index 7a81131..6f19079 100644 --- a/mods/bworld/scripts/stonecutting.ts +++ b/mods/bworld/scripts/stonecutting.ts @@ -4,7 +4,7 @@ // stonecutting recipes: the stonecutter cuts one item into another, picked from every recipe that takes it. the type is // registered by the shared script, so the server's menu and the client's screen both list them from ctx.recipes.all, in // the same order, so a button's number means the same recipe to both -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export const STONECUTTING = "bworld:stonecutting"; diff --git a/mods/bworld/scripts/trees.ts b/mods/bworld/scripts/trees.ts index 35afd1b..c6b350b 100644 --- a/mods/bworld/scripts/trees.ts +++ b/mods/bworld/scripts/trees.ts @@ -9,7 +9,7 @@ // other candidate within MIN_DISTANCE has a higher priority (then its biome may still say no). that spreads trees out // like poisson disk sampling: never closer than MIN_DISTANCE, but without lining up in a grid. a tree is placed by the // chunk its trunk is in, leaves that reach into the next chunk only fill air there -import type { FeatureBiome, FeatureChunk, WorldgenContext } from "bworld/worldgen"; +import type { FeatureBiome, FeatureChunk, WorldgenContext } from "cubi/worldgen"; const CHUNK_SIZE = 16; const CHUNK_HEIGHT = 256; diff --git a/mods/bworld/scripts/verdigris/devices.ts b/mods/bworld/scripts/verdigris/devices.ts index b6390ac..700a521 100644 --- a/mods/bworld/scripts/verdigris/devices.ts +++ b/mods/bworld/scripts/verdigris/devices.ts @@ -3,7 +3,7 @@ // the blocks that make and use signals. what they give out is their bworld:verdigris_source params, this is what makes // their states change -import type { BlockRef, Face, Position, ServerContext } from "bworld/server"; +import type { BlockRef, Face, Position, ServerContext } from "cubi/server"; import { power_from } from "./inputs.ts"; import type { SignalReader } from "./signals.ts"; import { type FacingParam, front_of, OPPOSITE, pack, step } from "./sides.ts"; diff --git a/mods/bworld/scripts/verdigris/inputs.ts b/mods/bworld/scripts/verdigris/inputs.ts index 6097528..7942d51 100644 --- a/mods/bworld/scripts/verdigris/inputs.ts +++ b/mods/bworld/scripts/verdigris/inputs.ts @@ -3,7 +3,7 @@ // the power blocks take in, see docs/modding/blocks/verdigris.md: a source's output, a solid block's power, and the // power of wire that lies on them or joins them -import type { Face } from "bworld/shared"; +import type { Face } from "cubi/shared"; import { block_power, type InputParams, MAX_POWER, output, sides_of, type SignalReader, WIRE } from "./signals.ts"; import { OPPOSITE, step } from "./sides.ts"; import { wire_at } from "./wires.ts"; diff --git a/mods/bworld/scripts/verdigris/joins.ts b/mods/bworld/scripts/verdigris/joins.ts index 9dbc2ae..b4aae32 100644 --- a/mods/bworld/scripts/verdigris/joins.ts +++ b/mods/bworld/scripts/verdigris/joins.ts @@ -5,7 +5,7 @@ // block on that side, and the wire on two faces that meet joins at that edge. a face's other directions lead out of the // cell, and its arm_ states say which of those it joins. the shared rule sets them the same on the server and clients, // and works out a join between two cells the same from either end -import type { Face } from "bworld/shared"; +import type { Face } from "cubi/shared"; import { AIR, type BlockReader, connects, WIRE } from "./signals.ts"; import { DIRECTIONS, FACES, OPPOSITE, step } from "./sides.ts"; diff --git a/mods/bworld/scripts/verdigris/server.ts b/mods/bworld/scripts/verdigris/server.ts index 1ce55f6..aedec37 100644 --- a/mods/bworld/scripts/verdigris/server.ts +++ b/mods/bworld/scripts/verdigris/server.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // verdigris's components: the wire, which keeps its net's power through the net index, sources, inputs, and the devices -import type { BlockRef, Face, Position, ServerContext } from "bworld/server"; +import type { BlockRef, Face, Position, ServerContext } from "cubi/server"; import { register_lever, register_pulse_repeater, register_torch } from "./devices.ts"; import { arms_of, around_edge, can_cover, covers, face_states, faces_of, MAX_ARMS } from "./joins.ts"; import { input_power } from "./inputs.ts"; diff --git a/mods/bworld/scripts/verdigris/shared.ts b/mods/bworld/scripts/verdigris/shared.ts index 23670fc..c22f25e 100644 --- a/mods/bworld/scripts/verdigris/shared.ts +++ b/mods/bworld/scripts/verdigris/shared.ts @@ -3,7 +3,7 @@ // verdigris placement and joins. rules, so a player sees a wire join or a lever turn to the wall the moment they place // it. power, delays and clicks are the server's, see server.ts -import type { BlockPlacement, Face, SharedContext } from "bworld/shared"; +import type { BlockPlacement, Face, SharedContext } from "cubi/shared"; import { arms_of, can_cover, face_states, faces_of } from "./joins.ts"; import { type BlockReader, type InputParams, params_lookup, type SourceParams } from "./signals.ts"; import { FACES, OPPOSITE, step } from "./sides.ts"; diff --git a/mods/bworld/scripts/verdigris/sides.ts b/mods/bworld/scripts/verdigris/sides.ts index 224799e..e0a0856 100644 --- a/mods/bworld/scripts/verdigris/sides.ts +++ b/mods/bworld/scripts/verdigris/sides.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // faces, and the directions along them a wire lying on one runs -import type { Face } from "bworld/shared"; +import type { Face } from "cubi/shared"; // the six faces in the order of a 3 bit facing state's values: a 2 bit facing's four, then top and bottom export const FACES: readonly Face[] = ["north", "east", "south", "west", "top", "bottom"]; diff --git a/mods/bworld/scripts/verdigris/signals.ts b/mods/bworld/scripts/verdigris/signals.ts index 64a376c..78f0d02 100644 --- a/mods/bworld/scripts/verdigris/signals.ts +++ b/mods/bworld/scripts/verdigris/signals.ts @@ -3,7 +3,7 @@ // the power blocks give each other, see docs/modding/blocks/verdigris.md. every signal is a block state, so this only // reads states, through a small world instead of ctx so it runs the same in shared scripts, server scripts and tests -import type { Face, Id } from "bworld/shared"; +import type { Face, Id } from "cubi/shared"; import { FACES, type FacingParam, front_of, named_sides, OPPOSITE, type SideName, step } from "./sides.ts"; export const WIRE = "bworld:verdigris_wire"; diff --git a/mods/bworld/scripts/verdigris/wires.ts b/mods/bworld/scripts/verdigris/wires.ts index f7d31a0..768a3fa 100644 --- a/mods/bworld/scripts/verdigris/wires.ts +++ b/mods/bworld/scripts/verdigris/wires.ts @@ -4,7 +4,7 @@ // wire nets: a wire cell and every wire cell it reaches through its joins are one net, and they all have the same // power, the most any block gives into any of them. a cell's faces always join each other, so it's one piece of one // net. NetIndex keeps the nets between changes -import type { Face } from "bworld/shared"; +import type { Face } from "cubi/shared"; import { cell_through, faces_of, joins_out, ways_out } from "./joins.ts"; import { type BlockReader, MAX_POWER, output, type SignalReader, solid_power } from "./signals.ts"; import { FACES, OPPOSITE, pack, step, unpack } from "./sides.ts"; diff --git a/mods/bworld/scripts/worldgen.ts b/mods/bworld/scripts/worldgen.ts index 1f67a9d..e35dd9f 100644 --- a/mods/bworld/scripts/worldgen.ts +++ b/mods/bworld/scripts/worldgen.ts @@ -3,7 +3,7 @@ // the base game's features, on top of the terrain (which is data, worldgen/). runs on the server and must give the // same world every time: only chunk.rng, chunk.random and the noise helpers, never Math.random or the time -import type { FeatureChunk, WorldgenContext } from "bworld/worldgen"; +import type { FeatureChunk, WorldgenContext } from "cubi/worldgen"; import { register_trees } from "./trees.ts"; export function setup(gen: WorldgenContext) { diff --git a/mods/create/scripts/client.ts b/mods/create/scripts/client.ts index 1175884..ef17bbc 100644 --- a/mods/create/scripts/client.ts +++ b/mods/create/scripts/client.ts @@ -14,8 +14,8 @@ import type { TransformedInstance, Visual, VisualBlock, -} from "bworld/client"; -import type { Face, FluidStack } from "bworld/shared"; +} from "cubi/client"; +import type { Face, FluidStack } from "cubi/shared"; import { actual_speed, type Axis, diff --git a/mods/create/scripts/kinetics/chains.ts b/mods/create/scripts/kinetics/chains.ts index 7c564ff..7694b29 100644 --- a/mods/create/scripts/kinetics/chains.ts +++ b/mods/create/scripts/kinetics/chains.ts @@ -4,7 +4,7 @@ // how chain drives join into lines: each keeps where it is in its line (start, middle, end, or none on its own) and // which way the line goes, and changes them as chain drives beside it come and go, like ChainDriveBlock.updateShape. // no ctx, so placing and neighbor rules both use it -import type { Face } from "bworld/shared"; +import type { Face } from "cubi/shared"; import { type Axis, chain_axis, type ChainPart, face_axis, positive } from "./connections.ts"; // a chain drive's states that matter for its line diff --git a/mods/create/scripts/kinetics/connections.ts b/mods/create/scripts/kinetics/connections.ts index 8d6660d..47a14e0 100644 --- a/mods/create/scripts/kinetics/connections.ts +++ b/mods/create/scripts/kinetics/connections.ts @@ -4,7 +4,7 @@ // what turns, and what turns what: a kinetic block's axis and the ends of it with an axle, and how fast one block turns // the one next to it, like create's IRotate and RotationPropagator.getRotationSpeedModifier. no ctx, so placement // rules, the server and visuals all read blocks the same way -import type { Face } from "bworld/shared"; +import type { Face } from "cubi/shared"; export type Axis = "x" | "y" | "z"; export type Pos = readonly [number, number, number]; diff --git a/mods/create/scripts/kinetics/generators.ts b/mods/create/scripts/kinetics/generators.ts index d18d4ca..5c1f36d 100644 --- a/mods/create/scripts/kinetics/generators.ts +++ b/mods/create/scripts/kinetics/generators.ts @@ -3,7 +3,7 @@ // what decides how fast generators turn: water flowing past a water wheel, and the creative motor's speed as it's // scrolled through. no ctx, so tests can call them directly -import type { Position } from "bworld/shared"; +import type { Position } from "cubi/shared"; import { AXES, type Axis, face_axis, FACE_OFFSETS, FACINGS, type Pos } from "./connections.ts"; // which way water around a wheel on axis at at turns it: 1 for counterclockwise seen from the axis's positive end, -1 diff --git a/mods/create/scripts/processing/basin.ts b/mods/create/scripts/processing/basin.ts index 4ff13df..7aec6aa 100644 --- a/mods/create/scripts/processing/basin.ts +++ b/mods/create/scripts/processing/basin.ts @@ -5,7 +5,7 @@ // stack of each, and BASIN_TANKS tanks with a fluid each. a kind of item or fluid only ever goes where there's already // some of it, so there's never two stacks or two tanks of one. no ctx, so the server keeps it and the client draws it // from the same shapes -import type { FluidStack, FluidVariant, ItemStack } from "bworld/shared"; +import type { FluidStack, FluidVariant, ItemStack } from "cubi/shared"; export const BASIN_SLOTS = 9; export const BASIN_TANKS = 2; diff --git a/mods/create/scripts/recipes/processing.ts b/mods/create/scripts/recipes/processing.ts index bff9645..c561d65 100644 --- a/mods/create/scripts/recipes/processing.ts +++ b/mods/create/scripts/recipes/processing.ts @@ -5,7 +5,7 @@ // stacks out, each with a chance, and for the types that can, fluids out as { fluid, amount }. the shared script // registers each type, so a broken recipe stops the mod loading instead of a machine later. no ctx, tests give what it // needs -import type { FluidStack, Id, RecipeType } from "bworld/shared"; +import type { FluidStack, Id, RecipeType } from "cubi/shared"; // how many ingredients, item results and fluid results a type takes at most, like getMaxInputCount, // getMaxOutputCount and getMaxFluidOutputCount diff --git a/mods/create/scripts/server.ts b/mods/create/scripts/server.ts index cf9796e..2d53eb6 100644 --- a/mods/create/scripts/server.ts +++ b/mods/create/scripts/server.ts @@ -3,7 +3,7 @@ // create's blocks that do something: so far what turns (create:kinetic), the generators that turn it (the hand crank, // the creative motor and the water wheel), the mechanical press and the basin -import type { BlockRef, EntityRef, FluidStack, Id, ItemStack, ServerContext } from "bworld/server"; +import type { BlockRef, EntityRef, FluidStack, Id, ItemStack, ServerContext } from "cubi/server"; import { actual_speed, along, diff --git a/mods/create/scripts/shared.ts b/mods/create/scripts/shared.ts index f24e287..55155c0 100644 --- a/mods/create/scripts/shared.ts +++ b/mods/create/scripts/shared.ts @@ -3,7 +3,7 @@ // how create's blocks are placed, on the server and on every client: kinetic blocks line up with the axles they're // placed against, and chain drives join into lines -import type { BlockPlacement, Face, Id, SharedContext } from "bworld/shared"; +import type { BlockPlacement, Face, Id, SharedContext } from "cubi/shared"; import { chain_update, type ChainState } from "./kinetics/chains.ts"; import { COMPACTING, PRESSING, processing_type } from "./recipes/processing.ts"; import { diff --git a/mods/recipe_viewer/scripts/categories.ts b/mods/recipe_viewer/scripts/categories.ts index b3715ed..7eb1aaf 100644 --- a/mods/recipe_viewer/scripts/categories.ts +++ b/mods/recipe_viewer/scripts/categories.ts @@ -4,7 +4,7 @@ // how each recipe type is shown, like jei's IRecipeCategory: a title, a fixed size every recipe of it is drawn in, the // blocks it's made in (jei's recipe catalysts), and where its items go. types no category knows get one from their // recipes' json, see mod_category -import type { ClientContext, FluidVariant, TagApi } from "bworld/client"; +import type { ClientContext, FluidVariant, TagApi } from "cubi/client"; import { fluid_outputs, type Ingredient, mod_recipe_inputs, outputs, type Recipe, seconds, stack } from "./recipes.ts"; // in gui pixels, a slot with its border, like minecraft's diff --git a/mods/recipe_viewer/scripts/client.ts b/mods/recipe_viewer/scripts/client.ts index a3e5faf..856a3e6 100644 --- a/mods/recipe_viewer/scripts/client.ts +++ b/mods/recipe_viewer/scripts/client.ts @@ -4,7 +4,7 @@ // a recipe viewer like just enough items: every item in a list next to the inventory, searchable, and clicking one (or // R and U over any item) opens a screen with the recipes that make it or the ones that use it, like jei's. it only // reads recipes, so it works with any mod's, and draws the ones it has no category for from their json -import type { ClientContext } from "bworld/client"; +import type { ClientContext } from "cubi/client"; import { type Entry, ItemList, type Mode } from "./item_list.ts"; import { RecipeIndex, RecipesScreen } from "./recipes_screen.ts"; diff --git a/mods/recipe_viewer/scripts/item_list.ts b/mods/recipe_viewer/scripts/item_list.ts index 8eaca72..723116d 100644 --- a/mods/recipe_viewer/scripts/item_list.ts +++ b/mods/recipe_viewer/scripts/item_list.ts @@ -3,7 +3,7 @@ // every item and fluid, right of the inventory and of the recipes screen, like jei's ingredient list overlay: the page // and its arrows on top, the items then the fluids, and the search box under them -import type { ClientContext, Color, FluidVariant, Graphics } from "bworld/client"; +import type { ClientContext, Color, FluidVariant, Graphics } from "cubi/client"; import { SLOT } from "./categories.ts"; const GAP = 5; diff --git a/mods/recipe_viewer/scripts/recipes.ts b/mods/recipe_viewer/scripts/recipes.ts index a925aca..29ecc55 100644 --- a/mods/recipe_viewer/scripts/recipes.ts +++ b/mods/recipe_viewer/scripts/recipes.ts @@ -3,7 +3,7 @@ // reading recipes: what each one makes and takes, for any mod's recipe type, so the viewer works with recipes it has // no category for -import type { FluidVariant, TagApi } from "bworld/client"; +import type { FluidVariant, TagApi } from "cubi/client"; // deno-lint-ignore no-explicit-any export type Recipe = any; diff --git a/mods/recipe_viewer/scripts/recipes_screen.ts b/mods/recipe_viewer/scripts/recipes_screen.ts index f3f0d3f..1d48216 100644 --- a/mods/recipe_viewer/scripts/recipes_screen.ts +++ b/mods/recipe_viewer/scripts/recipes_screen.ts @@ -5,7 +5,7 @@ // panel, where the category is made down its left side, the category and page with their arrows at the top, then as // many recipes as fit, one under the other. the item list stays on the right. escape or the inventory key go back to // the inventory, and backspace to what was shown before -import type { ClientContext, Graphics, Screen } from "bworld/client"; +import type { ClientContext, Graphics, Screen } from "cubi/client"; import { crabpot_recipes, fishing_recipes, diff --git a/server/game/crafting.ts b/server/game/crafting.ts index f296310..e85f3d4 100644 --- a/server/game/crafting.ts +++ b/server/game/crafting.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { Container, ItemStack } from "$/common/inventory.ts"; -import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts"; -import { choice_matches, type GridRecipe } from "$/common/mod_data.ts"; +import { Container, ItemStack } from "@/common/inventory.ts"; +import { CRAFTING_RESULT_SLOT } from "@/common/protocol.ts"; +import { choice_matches, type GridRecipe } from "@/common/mod_data.ts"; // recipes come from mods, see RecipeBook in common/mod_loader.ts diff --git a/server/game/entity/effects.ts b/server/game/entity/effects.ts index ac95883..2c8f1ec 100644 --- a/server/game/entity/effects.ts +++ b/server/game/entity/effects.ts @@ -4,7 +4,7 @@ // status effects on living entities, like minecraft's MobEffect and MobEffectInstance. an effect is a type plus // how strong it is and for how long. a weaker one that lasts longer waits hidden under the stronger one, and takes // over when that runs out -import type { EffectCategory } from "$/common/mod_data.ts"; +import type { EffectCategory } from "@/common/mod_data.ts"; import type { AttributeType, ModifierOperation } from "./attributes.ts"; import { finite } from "./entity.ts"; import type { LivingEntity } from "./living_entity.ts"; diff --git a/server/game/entity/entity.ts b/server/game/entity/entity.ts index 7198f4a..fa3f7a3 100644 --- a/server/game/entity/entity.ts +++ b/server/game/entity/entity.ts @@ -7,13 +7,13 @@ // // like minecraft's, a kind of entity inherits from one class (Entity, LivingEntity, Mob, or another kind) and can // implement any number of interfaces -import { TICKS_PER_SECOND } from "$/common/constants.ts"; -import type { BlockRegistry } from "$/common/everything_registry.ts"; -import type { ItemStack } from "$/common/inventory.ts"; -import type { Shape } from "$/common/block_shapes.ts"; -import type { Season } from "$/common/worldgen/biomes.ts"; -import { type Collisions, type FluidInCell, physics } from "$/common/physics.ts"; -import type { EntityData, EntityEvent, EntityInfo } from "$/common/protocol.ts"; +import { TICKS_PER_SECOND } from "@/common/constants.ts"; +import type { BlockRegistry } from "@/common/everything_registry.ts"; +import type { ItemStack } from "@/common/inventory.ts"; +import type { Shape } from "@/common/block_shapes.ts"; +import type { Season } from "@/common/worldgen/biomes.ts"; +import { type Collisions, type FluidInCell, physics } from "@/common/physics.ts"; +import type { EntityData, EntityEvent, EntityInfo } from "@/common/protocol.ts"; import type { ServerPlayer } from "../player.ts"; // below this, entities have fallen out of the world diff --git a/server/game/entity/entity_manager.ts b/server/game/entity/entity_manager.ts index e7f4a0b..dbe627d 100644 --- a/server/game/entity/entity_manager.ts +++ b/server/game/entity/entity_manager.ts @@ -4,12 +4,12 @@ // every entity in the world, and what each player's client knows about them. like minecraft's entity lookup plus // its ChunkMap's entity tracking: a player's client hears about the entities within their view distance, gets told // when those move or change, and forgets them when they leave it -import { CHUNK_SIZE } from "$/common/constants.ts"; -import { is_within_view } from "$/common/chunk_streaming.ts"; -import { fluid_block, fluid_in_cell } from "$/common/utils.ts"; -import { biome_season } from "$/common/worldgen/biomes.ts"; -import type { ItemStack } from "$/common/inventory.ts"; -import type { EntityEvent, EntityInfo, ServerMessage } from "$/common/protocol.ts"; +import { CHUNK_SIZE } from "@/common/constants.ts"; +import { is_within_view } from "@/common/chunk_streaming.ts"; +import { fluid_block, fluid_in_cell } from "@/common/utils.ts"; +import { biome_season } from "@/common/worldgen/biomes.ts"; +import type { ItemStack } from "@/common/inventory.ts"; +import type { EntityEvent, EntityInfo, ServerMessage } from "@/common/protocol.ts"; import type { ServerPlayer } from "../player.ts"; import type { ServerWorld } from "../world.ts"; import type { DamageSource, Entity, EntityLevel, SavedEntity } from "./entity.ts"; diff --git a/server/game/entity/item_entity.ts b/server/game/entity/item_entity.ts index 02befab..8c03cda 100644 --- a/server/game/entity/item_entity.ts +++ b/server/game/entity/item_entity.ts @@ -1,10 +1,10 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { type ItemData, ItemStack, same_stack } from "$/common/inventory.ts"; -import type { EntityInfo } from "$/common/protocol.ts"; -import { TICK_DELTA } from "$/common/constants.ts"; -import { physics } from "$/common/physics.ts"; +import { type ItemData, ItemStack, same_stack } from "@/common/inventory.ts"; +import type { EntityInfo } from "@/common/protocol.ts"; +import { TICK_DELTA } from "@/common/constants.ts"; +import { physics } from "@/common/physics.ts"; import { type Attacker, type DamageSource, Entity, finite, type SavedEntity } from "./entity.ts"; export const ITEM_ENTITY_TYPE = "cubi:item"; diff --git a/server/game/entity/living_entity.ts b/server/game/entity/living_entity.ts index c2f8835..e9475ea 100644 --- a/server/game/entity/living_entity.ts +++ b/server/game/entity/living_entity.ts @@ -4,9 +4,9 @@ // entities that live: health, attributes, status effects, equipment, breathing and dying, like minecraft's // LivingEntity. they walk with minecraft's physics, driven by forward, strafe and jumping (see travel), which is what // a mob's AI or anything else moving them sets -import { TICKS_PER_SECOND } from "$/common/constants.ts"; -import { type ItemData, ItemStack } from "$/common/inventory.ts"; -import type { EntityData } from "$/common/protocol.ts"; +import { TICKS_PER_SECOND } from "@/common/constants.ts"; +import { type ItemData, ItemStack } from "@/common/inventory.ts"; +import type { EntityData } from "@/common/protocol.ts"; import { AttributeMap, ATTRIBUTES, type AttributeType } from "./attributes.ts"; import { EffectInstance, type SavedEffect } from "./effects.ts"; import { DAMAGE, type DamageSource, Entity, finite, type SavedEntity } from "./entity.ts"; diff --git a/server/game/entity/mob.ts b/server/game/entity/mob.ts index 7c45cb2..7b43c8d 100644 --- a/server/game/entity/mob.ts +++ b/server/game/entity/mob.ts @@ -8,9 +8,9 @@ import { type DamageSource, Entity, finite } from "./entity.ts"; import { GoalSelector } from "./goals.ts"; import { ItemEntity } from "./item_entity.ts"; import { EQUIPMENT_SLOTS, type EquipmentSlot, LivingEntity, type SavedLivingEntity } from "./living_entity.ts"; -import type { EntityData } from "$/common/protocol.ts"; -import type { ItemStack } from "$/common/inventory.ts"; -import { wrap_angle } from "$/common/utils.ts"; +import type { EntityData } from "@/common/protocol.ts"; +import type { ItemStack } from "@/common/inventory.ts"; +import { wrap_angle } from "@/common/utils.ts"; // minecraft's despawning distances: gone at once past the first, maybe after a while past the second const DESPAWN_DISTANCE = 128; diff --git a/server/game/entity/mod_entity.ts b/server/game/entity/mod_entity.ts index 0bc7557..0c31944 100644 --- a/server/game/entity/mod_entity.ts +++ b/server/game/entity/mod_entity.ts @@ -4,7 +4,7 @@ // the kinds of entity mods define in entities/.json (see EntityJson): animals that wander around, panic when hurt // and look at players now and then, like minecraft's simpler animals, monsters that go after players, and scripted // ones that stay where scripts put them -import type { EntityJson } from "$/common/mod_data.ts"; +import type { EntityJson } from "@/common/mod_data.ts"; import { ATTRIBUTES, type AttributeType } from "./attributes.ts"; import { Entity } from "./entity.ts"; import type { EntityFactory } from "./entity_types.ts"; diff --git a/server/game/fluid_handlers.ts b/server/game/fluid_handlers.ts index 3273a5d..1f5ecdb 100644 --- a/server/game/fluid_handlers.ts +++ b/server/game/fluid_handlers.ts @@ -3,8 +3,8 @@ // the fluid handlers the engine makes for server scripts, see ServerFluidApi in mod_api/server.ts: fluid containers', // tanks scripts keep, and pouring from one handler into another -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import { contained_fluid } from "$/common/inventory.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import { contained_fluid } from "@/common/inventory.ts"; import type { FluidAction, FluidHandler, @@ -13,8 +13,8 @@ import type { ItemStack, Player, TankHandlerOptions, -} from "$/common/mod_api/server.ts"; -import { same_fluid } from "$/common/fluids.ts"; +} from "@/common/mod_api/server.ts"; +import { same_fluid } from "@/common/fluids.ts"; // one of a stack of fluid containers, full of its whole capacity or empty, undefined for an item that isn't one export function item_handler(stack: ItemStack): FluidHandlerItem | undefined { diff --git a/server/game/fluids.ts b/server/game/fluids.ts index 50b9bb2..700e13b 100644 --- a/server/game/fluids.ts +++ b/server/game/fluids.ts @@ -4,10 +4,10 @@ // fluids flowing, like minecraft's FlowingFluid: a change next to a fluid gets the cells around it looked at again // after the fluid's ticks, and each works out what it should be from its neighbors (see next_level). that changes // more cells, and so it spreads one block a step, and drains away the same way once its source is gone -import { AIR, CHUNK_HEIGHT, ID_MASK } from "$/common/constants.ts"; -import type { BlockRegistry } from "$/common/everything_registry.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { fluid_block, get_state_value, set_state_value } from "$/common/utils.ts"; +import { AIR, CHUNK_HEIGHT, ID_MASK } from "@/common/constants.ts"; +import type { BlockRegistry } from "@/common/everything_registry.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { fluid_block, get_state_value, set_state_value } from "@/common/utils.ts"; // what the flow needs of the world export interface FluidWorld { diff --git a/server/game/game_loop.ts b/server/game/game_loop.ts index e709671..11ed211 100644 --- a/server/game/game_loop.ts +++ b/server/game/game_loop.ts @@ -3,7 +3,7 @@ // runs the game at a fixed rate. a slow tick makes the next ones run back to back until the game catches up, // so game time keeps up with real time. if it falls too far behind, it skips ahead instead and says so -import { TICKS_PER_SECOND } from "$/common/constants.ts"; +import { TICKS_PER_SECOND } from "@/common/constants.ts"; // at most this many ticks in a row to catch up, then skip the rest const MAX_CATCH_UP_TICKS = 10; diff --git a/server/game/game_server.ts b/server/game/game_server.ts index 846580b..7241014 100644 --- a/server/game/game_server.ts +++ b/server/game/game_server.ts @@ -13,10 +13,10 @@ import { PLAYER_WIDTH, TICK_DELTA, TICKS_PER_SECOND, -} from "$/common/constants.ts"; -import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; +} from "@/common/constants.ts"; +import { BlockRegistry, EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; import { FluidFlow } from "./fluids.ts"; -import { contained_fluid, Container, ItemData, ItemStack } from "$/common/inventory.ts"; +import { contained_fluid, Container, ItemData, ItemStack } from "@/common/inventory.ts"; import { AIR_ID, ClientMessage, @@ -24,13 +24,13 @@ import { MAX_NAME_LENGTH, PROTOCOL_VERSION, ServerMessage, -} from "$/common/protocol.ts"; -import type { ModListing, RecipeBook } from "$/common/mod_loader.ts"; -import type { WorldgenSetup } from "$/common/generation.ts"; -import type { WorldgenBundle } from "$/common/worldgen_bundle.ts"; +} from "@/common/protocol.ts"; +import type { ModListing, RecipeBook } from "@/common/mod_loader.ts"; +import type { WorldgenSetup } from "@/common/generation.ts"; +import type { WorldgenBundle } from "@/common/worldgen_bundle.ts"; import type { WorldgenPool } from "./worldgen_pool.ts"; -import { MAX_VIEW_DISTANCE, MIN_VIEW_DISTANCE } from "$/common/chunk_streaming.ts"; -import { CYCLE_TICKS, format_clock, time_of_day, TIMES_OF_DAY } from "$/common/time.ts"; +import { MAX_VIEW_DISTANCE, MIN_VIEW_DISTANCE } from "@/common/chunk_streaming.ts"; +import { CYCLE_TICKS, format_clock, time_of_day, TIMES_OF_DAY } from "@/common/time.ts"; import { block_states, box_overlaps_block, @@ -43,13 +43,13 @@ import { placement_target, set_state_value, waterlog_placement, -} from "$/common/utils.ts"; -import { collision_shape_at, type Shape } from "$/common/block_shapes.ts"; -import { physics } from "$/common/physics.ts"; +} from "@/common/utils.ts"; +import { collision_shape_at, type Shape } from "@/common/block_shapes.ts"; +import { physics } from "@/common/physics.ts"; import { EXHAUSTION } from "./vitals.ts"; import { entity_ref, ModRuntime, new_stack, run_guarded, type ServerCommandSource } from "./mod_runtime.ts"; -import type { LootContext, UseTarget } from "$/common/mod_api/server.ts"; -import type { EntityJson } from "$/common/mod_data.ts"; +import type { LootContext, UseTarget } from "@/common/mod_api/server.ts"; +import type { EntityJson } from "@/common/mod_data.ts"; import { argument, choice, @@ -63,8 +63,8 @@ import { literal, number, word, -} from "$/common/commands.ts"; -import { biome_ids, get_biome } from "$/common/worldgen/biomes.ts"; +} from "@/common/commands.ts"; +import { biome_ids, get_biome } from "@/common/worldgen/biomes.ts"; import type { GameLoop } from "./game_loop.ts"; import { update_crafting_result } from "./crafting.ts"; import type { Menu } from "./menu.ts"; diff --git a/server/game/host_protocol.ts b/server/game/host_protocol.ts index 95db1e5..d96aa83 100644 --- a/server/game/host_protocol.ts +++ b/server/game/host_protocol.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import type { ModData, ModListing } from "$/common/mod_loader.ts"; +import type { ModData, ModListing } from "@/common/mod_loader.ts"; import type { WorldSave } from "./saves.ts"; // messages between server/main.ts (the host) and the game server worker diff --git a/server/game/load_mods.ts b/server/game/load_mods.ts index d54d544..b321efe 100644 --- a/server/game/load_mods.ts +++ b/server/game/load_mods.ts @@ -3,18 +3,18 @@ // starts a game server with its mods: registers their data, then imports worldgen and server scripts. // the worker loads built mods, tests can load mods straight from their source folders -import { register_mod_data } from "$/common/mod_loader.ts"; -import type { ModData, ModListing } from "$/common/mod_loader.ts"; -import { load_worldgen } from "$/common/worldgen_loader.ts"; -import { worldgen_bundle } from "$/common/worldgen_bundle.ts"; +import { register_mod_data } from "@/common/mod_loader.ts"; +import type { ModData, ModListing } from "@/common/mod_loader.ts"; +import { load_worldgen } from "@/common/worldgen_loader.ts"; +import { worldgen_bundle } from "@/common/worldgen_bundle.ts"; import { GameHost, GameServer } from "./game_server.ts"; import type { WorldSource } from "./saves.ts"; import { ModRuntime } from "./mod_runtime.ts"; import { register_entity_type } from "./entity/entity_types.ts"; import { mod_entity_factory } from "./entity/mod_entity.ts"; import { set_effect_types } from "./entity/effects.ts"; -import { clear_hooks, expose_engine } from "$/common/hooks.ts"; -import { common_engine } from "$/common/engine_modules.ts"; +import { clear_hooks, expose_engine } from "@/common/hooks.ts"; +import { common_engine } from "@/common/engine_modules.ts"; import { server_engine } from "./engine_modules.ts"; // the generator worlds use: a mod's worldgen/noise_settings, the base game's overworld. the server doesn't start diff --git a/server/game/loot.ts b/server/game/loot.ts index 860421c..f061925 100644 --- a/server/game/loot.ts +++ b/server/game/loot.ts @@ -3,7 +3,7 @@ // the server's loot tables: rolling them (see common/loot.ts) with the conditions, functions and modifiers mods // register through ctx.loot. what a mod's code throws is logged under it and the roll carries on without it -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; import { loot_references, type LootCondition, @@ -14,9 +14,9 @@ import { type LootTableJson, roll_loot, validate_loot_table, -} from "$/common/loot.ts"; -import type { ItemStack, LootContext, LootParams } from "$/common/mod_api/server.ts"; -import { ModLoadError } from "$/common/mod_loader.ts"; +} from "@/common/loot.ts"; +import type { ItemStack, LootContext, LootParams } from "@/common/mod_api/server.ts"; +import { ModLoadError } from "@/common/mod_loader.ts"; import { run_guarded } from "./mod_runtime.ts"; type Modifier = (items: ItemStack[], context: LootContext, table: string) => ItemStack[] | void; diff --git a/server/game/menu.ts b/server/game/menu.ts index 894045d..6a2268e 100644 --- a/server/game/menu.ts +++ b/server/game/menu.ts @@ -13,7 +13,7 @@ import { move_into, room_for, take_output, -} from "$/common/inventory.ts"; +} from "@/common/inventory.ts"; import { CRAFTING_RESULT_SLOT, type MenuFluidSlotInfo, @@ -22,8 +22,8 @@ import { PLAYER_MENU, PLAYER_MENU_CRAFTING, PLAYER_MENU_EXTRA, -} from "$/common/protocol.ts"; -import type { GridRecipe } from "$/common/mod_data.ts"; +} from "@/common/protocol.ts"; +import type { GridRecipe } from "@/common/mod_data.ts"; import { consume_recipe_items, update_crafting_result } from "./crafting.ts"; export interface MenuSlot { diff --git a/server/game/mod_runtime.ts b/server/game/mod_runtime.ts index a82d949..2e3248b 100644 --- a/server/game/mod_runtime.ts +++ b/server/game/mod_runtime.ts @@ -3,13 +3,13 @@ // runs mods' server scripts: builds each one's ServerContext and keeps what they register. // see docs/modding/. parts not built yet throw when used, saying so -import { BlockRegistry, EverythingRegistry, fluid_height, ItemRegistry } from "$/common/everything_registry.ts"; +import { BlockRegistry, EverythingRegistry, fluid_height, ItemRegistry } from "@/common/everything_registry.ts"; import { Container as EngineContainer, ItemStack as EngineItemStack, max_stack, sell_value, -} from "$/common/inventory.ts"; +} from "@/common/inventory.ts"; import { block_states, fluid_block, @@ -17,18 +17,18 @@ import { is_waterlogged, set_state_value, shared_items_api, -} from "$/common/utils.ts"; +} from "@/common/utils.ts"; import { LootTables } from "./loot.ts"; -import { collision_shape_at, covers_face, is_solid, raycast_blocks, type Shape } from "$/common/block_shapes.ts"; -import { AIR, CHUNK_SIZE, faces, ID_MASK } from "$/common/constants.ts"; -import { physics } from "$/common/physics.ts"; -import { clock } from "$/common/time.ts"; -import { BlockRules } from "$/common/block_rules.ts"; -import { fluid_exists, FluidRules, same_fluid } from "$/common/fluids.ts"; +import { collision_shape_at, covers_face, is_solid, raycast_blocks, type Shape } from "@/common/block_shapes.ts"; +import { AIR, CHUNK_SIZE, faces, ID_MASK } from "@/common/constants.ts"; +import { physics } from "@/common/physics.ts"; +import { clock } from "@/common/time.ts"; +import { BlockRules } from "@/common/block_rules.ts"; +import { fluid_exists, FluidRules, same_fluid } from "@/common/fluids.ts"; import { interact, item_handler, tank_handler, transfer, use_container } from "./fluid_handlers.ts"; -import type { SharedContext } from "$/common/mod_api/shared.ts"; -import { tag_api } from "$/common/tags.ts"; -import { loading_mod } from "$/common/hooks.ts"; +import type { SharedContext } from "@/common/mod_api/shared.ts"; +import { tag_api } from "@/common/tags.ts"; +import { loading_mod } from "@/common/hooks.ts"; import type { BlockComponent, BlockRef, @@ -56,8 +56,8 @@ import type { ServerBeforeEvents, ServerContext, SlotOptions, -} from "$/common/mod_api/server.ts"; -import { check_recipe_types, ModLoadError, recipe_lookup, shared_recipes_api } from "$/common/mod_loader.ts"; +} from "@/common/mod_api/server.ts"; +import { check_recipe_types, ModLoadError, recipe_lookup, shared_recipes_api } from "@/common/mod_loader.ts"; import { argument, block as block_argument, @@ -74,20 +74,20 @@ import { literal, number, word, -} from "$/common/commands.ts"; -import { AIR_ID } from "$/common/protocol.ts"; +} from "@/common/commands.ts"; +import { AIR_ID } from "@/common/protocol.ts"; import type { GameServer } from "./game_server.ts"; import { MAX_PRIORITY, MIN_PRIORITY } from "./scheduled_ticks.ts"; import type { ServerPlayer } from "./player.ts"; import { Menu, type MenuFluidSlot, type MenuSlot } from "./menu.ts"; import { damage_source, type Entity } from "./entity/entity.ts"; import type { LivingEntity } from "./entity/living_entity.ts"; -import type { EffectJson } from "$/common/mod_data.ts"; +import type { EffectJson } from "@/common/mod_data.ts"; import { create_entity } from "./entity/entity_types.ts"; import { BLOCK_DROP_PICKUP_DELAY, ItemEntity } from "./entity/item_entity.ts"; import { attribute_type, type AttributeType, MODIFIER_OPERATIONS } from "./entity/attributes.ts"; import { effect_type, EffectInstance, type EffectType } from "./entity/effects.ts"; -import { biome_season } from "$/common/worldgen/biomes.ts"; +import { biome_season } from "@/common/worldgen/biomes.ts"; // a list of handlers that can't break each other: one throwing is logged under its mod and the rest still run export class Signal { @@ -119,7 +119,7 @@ export class Signal { // the mod whose code is running right now, for apis shared between mods that need to know who called let running_mod = ""; -// a mod's script, imported from url. engine_access lets it import bworld/engine +// a mod's script, imported from url. engine_access lets it import cubi/engine // a component a block lists, with its params from the block's json export interface BlockComponentOf { mod: string; diff --git a/server/game/natural_spawner.ts b/server/game/natural_spawner.ts index 31c860e..ad73b95 100644 --- a/server/game/natural_spawner.ts +++ b/server/game/natural_spawner.ts @@ -4,9 +4,9 @@ // monsters spawning on their own near players, like minecraft's NaturalSpawner: every tick, one try in each chunk // around players while there's room under the monster cap. what spawns comes from mods' worldgen/spawns.json (see // SpawnJson), the way undergarden's biomes list its rotspawn -import { CHUNK_SIZE } from "$/common/constants.ts"; -import type { SpawnJson } from "$/common/mod_data.ts"; -import { chunk_key } from "$/common/utils.ts"; +import { CHUNK_SIZE } from "@/common/constants.ts"; +import type { SpawnJson } from "@/common/mod_data.ts"; +import { chunk_key } from "@/common/utils.ts"; import type { EntityManager } from "./entity/entity_manager.ts"; import { create_entity } from "./entity/entity_types.ts"; import { Mob } from "./entity/mob.ts"; diff --git a/server/game/player.ts b/server/game/player.ts index 21d821b..08e00b2 100644 --- a/server/game/player.ts +++ b/server/game/player.ts @@ -7,12 +7,12 @@ import { PLAYER_SWIM_EYE_HEIGHT, PLAYER_SWIM_HEIGHT, PLAYER_WIDTH, -} from "$/common/constants.ts"; -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import { Container, Cursor, ItemData, ItemStack } from "$/common/inventory.ts"; -import type { GridRecipe } from "$/common/mod_data.ts"; +} from "@/common/constants.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import { Container, Cursor, ItemData, ItemStack } from "@/common/inventory.ts"; +import type { GridRecipe } from "@/common/mod_data.ts"; import { Menu, PlayerMenu } from "./menu.ts"; -import { PlayerInfo } from "$/common/protocol.ts"; +import { PlayerInfo } from "@/common/protocol.ts"; import { EXHAUSTION, type SavedVitals, Vitals } from "./vitals.ts"; import { PlayerChunks } from "./player_chunks.ts"; import { ATTRIBUTES, type AttributeType } from "./entity/attributes.ts"; diff --git a/server/game/player_chunks.ts b/server/game/player_chunks.ts index a78a4de..518c696 100644 --- a/server/game/player_chunks.ts +++ b/server/game/player_chunks.ts @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { CHUNK_SIZE } from "$/common/constants.ts"; -import { is_within_view } from "$/common/chunk_streaming.ts"; -import { chunk_key } from "$/common/utils.ts"; +import { CHUNK_SIZE } from "@/common/constants.ts"; +import { is_within_view } from "@/common/chunk_streaming.ts"; +import { chunk_key } from "@/common/utils.ts"; // minecraft's PlayerChunkSender numbers const START_CHUNKS_PER_TICK = 9; diff --git a/server/game/saves.ts b/server/game/saves.ts index 2f17f63..cffad8c 100644 --- a/server/game/saves.ts +++ b/server/game/saves.ts @@ -16,7 +16,7 @@ // generation only shows in chunks never generated before. // format 1 had no biomes, and a bit per block after the blocks for whether world generation made it, from when only // chunks players changed were saved. both are read -import { CHUNK_AREA, CHUNK_HEIGHT } from "$/common/constants.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT } from "@/common/constants.ts"; export const CHUNK_FORMAT = 2; export const CHUNK_VOLUME = CHUNK_AREA * CHUNK_HEIGHT; diff --git a/server/game/scheduled_ticks.ts b/server/game/scheduled_ticks.ts index 84ad010..3d3b249 100644 --- a/server/game/scheduled_ticks.ts +++ b/server/game/scheduled_ticks.ts @@ -3,8 +3,8 @@ // ticks blocks asked for some ticks ahead, see ServerWorld.schedule_tick. kept by chunk and grouped by when they're due, // so a tick costs nothing until it's due, and a chunk with none due is passed over with one comparison -import { CHUNK_SIZE } from "$/common/constants.ts"; -import { chunk_key } from "$/common/utils.ts"; +import { CHUNK_SIZE } from "@/common/constants.ts"; +import { chunk_key } from "@/common/utils.ts"; import { index_in_chunk } from "./world.ts"; // the most that run in one tick. the rest run first the next diff --git a/server/game/vitals.ts b/server/game/vitals.ts index ce3e0d9..1c3b390 100644 --- a/server/game/vitals.ts +++ b/server/game/vitals.ts @@ -3,7 +3,7 @@ // a player's hunger and saturation, with minecraft's rules (its FoodData), and what they do to health. the server // owns them, clients only draw them -import { TICKS_PER_SECOND } from "$/common/constants.ts"; +import { TICKS_PER_SECOND } from "@/common/constants.ts"; export const MAX_HEALTH = 20; export const MAX_FOOD = 20; diff --git a/server/game/world.ts b/server/game/world.ts index d3b69a6..211aa56 100644 --- a/server/game/world.ts +++ b/server/game/world.ts @@ -1,21 +1,21 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts"; +import { AIR, CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts"; import { block_light_emission, block_light_opacity, BlockRegistry, EverythingRegistry, -} from "$/common/everything_registry.ts"; -import { generate_raw_chunk, RawChunk, WorldgenSetup } from "$/common/generation.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { block_value, chunk_key } from "$/common/utils.ts"; -import { block_numbering } from "$/common/worldgen_bundle.ts"; +} from "@/common/everything_registry.ts"; +import { generate_raw_chunk, RawChunk, WorldgenSetup } from "@/common/generation.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { block_value, chunk_key } from "@/common/utils.ts"; +import { block_numbering } from "@/common/worldgen_bundle.ts"; import { LruMap } from "./lru.ts"; -import { collision_shape_at, EMPTY_SHAPE, type Shape } from "$/common/block_shapes.ts"; -import { farming_day } from "$/common/time.ts"; -import { encode_level_chunk } from "$/common/chunk_streaming.ts"; +import { collision_shape_at, EMPTY_SHAPE, type Shape } from "@/common/block_shapes.ts"; +import { farming_day } from "@/common/time.ts"; +import { encode_level_chunk } from "@/common/chunk_streaming.ts"; import { CHUNK_VOLUME, ChunkBlocks, decode_chunk, encode_chunk, SavedChunk, SavedChunks } from "./saves.ts"; // generation only, rebuilt when needed. 256 KB each. with a worldgen pool, it holds what the pool made until the diff --git a/server/game/worldgen_pool.ts b/server/game/worldgen_pool.ts index 6b80aa7..355316e 100644 --- a/server/game/worldgen_pool.ts +++ b/server/game/worldgen_pool.ts @@ -5,9 +5,9 @@ // workers and gives the game a port to each, since the game has no permissions to start them itself (see // server/worldgen_workers.ts). requests go nearest first, a worker has a couple at a time so priorities stay fresh, and what the // game stops wanting is dropped before it starts -import type { RawChunk } from "$/common/generation.ts"; -import type { WorldgenBundle } from "$/common/worldgen_bundle.ts"; -import { chunk_key } from "$/common/utils.ts"; +import type { RawChunk } from "@/common/generation.ts"; +import type { WorldgenBundle } from "@/common/worldgen_bundle.ts"; +import { chunk_key } from "@/common/utils.ts"; export type PoolToWorker = | { type: "init"; bundle: WorldgenBundle } diff --git a/server/game/worldgen_worker.ts b/server/game/worldgen_worker.ts index 7fbeb13..d4112ad 100644 --- a/server/game/worldgen_worker.ts +++ b/server/game/worldgen_worker.ts @@ -6,9 +6,9 @@ // generates chunks for the game, off its thread. the host starts it without permissions, like the game, and hands it // a port the game talks to it through (see server/worldgen_workers.ts and worldgen_pool.ts). the game sends the // worldgen bundle once, then chunks to generate, and gets their blocks back moved, not copied -import { load_bundle, type LoadedBundle } from "$/common/worldgen_bundle.ts"; -import { expose_engine } from "$/common/hooks.ts"; -import { common_engine } from "$/common/engine_modules.ts"; +import { load_bundle, type LoadedBundle } from "@/common/worldgen_bundle.ts"; +import { expose_engine } from "@/common/hooks.ts"; +import { common_engine } from "@/common/engine_modules.ts"; import type { PoolToWorker, WorkerToPool } from "./worldgen_pool.ts"; self.onmessage = (event: MessageEvent<{ port: MessagePort }>) => { diff --git a/server/load_bmods.ts b/server/load_bmods.ts index f03aba1..b97d13d 100644 --- a/server/load_bmods.ts +++ b/server/load_bmods.ts @@ -4,12 +4,12 @@ // the server's mods: every .bmod in server_mods/, checked, with the server's changes to their config, sorted so // dependencies load first, and with the copy players download (the same mod without its server script) ready to serve import { join } from "@std/path"; -import { type Bmod, BMOD_EXTENSION, client_copy, read_bmod, write_bmod } from "$/common/bmod.ts"; -import { check_references, load_order, type LoadedMod } from "$/common/mod_check.ts"; -import type { ModListing } from "$/common/mod_loader.ts"; -import { data_file, FORMAT_VERSION } from "$/common/mod_data.ts"; -import { is_object, json_object } from "$/common/schema.ts"; -import { sha256 } from "$/common/utils.ts"; +import { type Bmod, BMOD_EXTENSION, client_copy, read_bmod, write_bmod } from "@/common/bmod.ts"; +import { check_references, load_order, type LoadedMod } from "@/common/mod_check.ts"; +import type { ModListing } from "@/common/mod_loader.ts"; +import { data_file, FORMAT_VERSION } from "@/common/mod_data.ts"; +import { is_object, json_object } from "@/common/schema.ts"; +import { sha256 } from "@/common/utils.ts"; export interface ServerMod { bmod: Bmod; diff --git a/templates/mod/scripts/client.ts b/templates/mod/scripts/client.ts index 25d8ef1..6b0c6f8 100644 --- a/templates/mod/scripts/client.ts +++ b/templates/mod/scripts/client.ts @@ -1,4 +1,4 @@ -import type { ClientContext } from "bworld/client"; +import type { ClientContext } from "cubi/client"; // called on every player's client after the mod is downloaded, before the world shows up. // everything here is visible to players, so keep secrets and game rules in server.ts diff --git a/templates/mod/scripts/server.ts b/templates/mod/scripts/server.ts index 5cfecca..6842211 100644 --- a/templates/mod/scripts/server.ts +++ b/templates/mod/scripts/server.ts @@ -1,4 +1,4 @@ -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; // called once when the server starts export function setup(ctx: ServerContext) { diff --git a/templates/mod/scripts/worldgen.ts b/templates/mod/scripts/worldgen.ts index 35d5b3f..1255fd6 100644 --- a/templates/mod/scripts/worldgen.ts +++ b/templates/mod/scripts/worldgen.ts @@ -1,4 +1,4 @@ -import type { WorldgenContext } from "bworld/worldgen"; +import type { WorldgenContext } from "cubi/worldgen"; // runs in chunk workers on the server and every client, which must all generate the same world. // only use chunk.rng and the noise helpers, never Math.random or the time diff --git a/tests/artifacts_test.ts b/tests/artifacts_test.ts index 350f674..8e59548 100644 --- a/tests/artifacts_test.ts +++ b/tests/artifacts_test.ts @@ -3,8 +3,8 @@ // artifacts: items worn in curios slots that change the wearer's attributes, see mods/artifacts import { assertEquals } from "@std/assert"; -import { ATTRIBUTES } from "$/server/game/entity/attributes.ts"; -import { PLAYER_MENU_EXTRA } from "$/common/protocol.ts"; +import { ATTRIBUTES } from "@/server/game/entity/attributes.ts"; +import { PLAYER_MENU_EXTRA } from "@/common/protocol.ts"; import { container_items, test_game } from "./helpers.ts"; async function setup() { diff --git a/tests/base_game_test.ts b/tests/base_game_test.ts index e21d876..cc99012 100644 --- a/tests/base_game_test.ts +++ b/tests/base_game_test.ts @@ -3,10 +3,10 @@ // the base game's block and item behavior: hoeing, chests, furnaces, crops and the watering can import { assert, assertEquals } from "@std/assert"; -import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; -import { sell_value } from "$/common/inventory.ts"; -import { CYCLE_TICKS } from "$/common/time.ts"; -import { display_name, get_state_value } from "$/common/utils.ts"; +import { BlockRegistry, EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; +import { sell_value } from "@/common/inventory.ts"; +import { CYCLE_TICKS } from "@/common/time.ts"; +import { display_name, get_state_value } from "@/common/utils.ts"; import { container_items, menu_data, menu_items, opened_menu, stone_floor, test_game } from "./helpers.ts"; // deno-lint-ignore no-explicit-any diff --git a/tests/benchmark_test.ts b/tests/benchmark_test.ts index 0aca3e0..23df62c 100644 --- a/tests/benchmark_test.ts +++ b/tests/benchmark_test.ts @@ -3,10 +3,10 @@ // the render benchmark's numbers, its report, and its level, which has to be the same in every run for runs to compare import { assert, assertEquals } from "@std/assert"; -import { type BenchmarkReport, format_report, frame_stats, parse_report } from "$/client/benchmark/report.ts"; -import { bench_blocks, BenchTerrain, ZONES } from "$/client/benchmark/bench_level.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { AIR, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts"; +import { type BenchmarkReport, format_report, frame_stats, parse_report } from "@/client/benchmark/report.ts"; +import { bench_blocks, BenchTerrain, ZONES } from "@/client/benchmark/bench_level.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { AIR, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts"; import { test_game } from "./helpers.ts"; Deno.test("the lows are the fps of the slowest frames", () => { diff --git a/tests/biome_test.ts b/tests/biome_test.ts index ddfe20a..55b3ec4 100644 --- a/tests/biome_test.ts +++ b/tests/biome_test.ts @@ -3,7 +3,7 @@ // biomes are data, worldgen/biomes/.json in a mod. see common/worldgen/biomes.ts import { assert, assertEquals } from "@std/assert"; -import { CYCLE_TICKS } from "$/common/time.ts"; +import { CYCLE_TICKS } from "@/common/time.ts"; import { biome_from_json, biome_ids, @@ -11,7 +11,7 @@ import { calendar_season, get_biome, validate_biome, -} from "$/common/worldgen/biomes.ts"; +} from "@/common/worldgen/biomes.ts"; import { test_game } from "./helpers.ts"; const PLAIN = { id: "my_mod:flat", surface: { top: "bworld:grass_block", filler: "bworld:dirt", filler_depth: 3 } }; diff --git a/tests/block_models_test.ts b/tests/block_models_test.ts index 98888db..27f7904 100644 --- a/tests/block_models_test.ts +++ b/tests/block_models_test.ts @@ -10,9 +10,9 @@ import { BUILTIN_MODELS, type ModelJson, resolve_texture, -} from "$/common/block_models.ts"; -import { block_from_json, validate_block } from "$/common/mod_data.ts"; -import { set_state_value } from "$/common/utils.ts"; +} from "@/common/block_models.ts"; +import { block_from_json, validate_block } from "@/common/mod_data.ts"; +import { set_state_value } from "@/common/utils.ts"; const cube = BUILTIN_MODELS["cubi:cube"]; diff --git a/tests/block_predictions_test.ts b/tests/block_predictions_test.ts index 146134d..5b315ce 100644 --- a/tests/block_predictions_test.ts +++ b/tests/block_predictions_test.ts @@ -4,7 +4,7 @@ // what a client guesses about blocks waits for the server's block_ack before the server's word replaces it, like // minecraft's BlockStatePredictionHandler, so clicking fast doesn't flicker. see client/level/block_predictions.ts import { assertEquals } from "@std/assert"; -import { BlockPredictions } from "$/client/level/block_predictions.ts"; +import { BlockPredictions } from "@/client/level/block_predictions.ts"; import { test_game } from "./helpers.ts"; const CLOSED = { x: 0, y: 100, z: 0, id: "bworld:oak_trapdoor", state: 0 }; diff --git a/tests/block_shapes_test.ts b/tests/block_shapes_test.ts index 40a98c7..73656c3 100644 --- a/tests/block_shapes_test.ts +++ b/tests/block_shapes_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; -import { BUILTIN_MODELS, type ModelJson } from "$/common/block_models.ts"; +import { BUILTIN_MODELS, type ModelJson } from "@/common/block_models.ts"; import { block_shape, clip_shape, @@ -13,10 +13,10 @@ import { model_shape, raycast_blocks, type Shape, -} from "$/common/block_shapes.ts"; -import { block_from_json, type BlockJson, validate_block } from "$/common/mod_data.ts"; -import { move_body } from "$/common/physics.ts"; -import { box_overlaps_block } from "$/common/utils.ts"; +} from "@/common/block_shapes.ts"; +import { block_from_json, type BlockJson, validate_block } from "@/common/mod_data.ts"; +import { move_body } from "@/common/physics.ts"; +import { box_overlaps_block } from "@/common/utils.ts"; const slab: ModelJson = { id: "test:slab", @@ -115,7 +115,7 @@ Deno.test("only a placed block's boxes are in the way of whoever stands there", }); Deno.test("the outline is the edges of the shape's boxes, a little outside them", async () => { - const { shape_edges } = await import("$/client/rendering/level_renderer.ts"); + const { shape_edges } = await import("@/client/rendering/level_renderer.ts"); const cube = shape_edges(FULL_SHAPE); assertEquals(cube.length, 12); assert(cube.every((edge) => edge.every((v) => v < 0 || v > 1))); diff --git a/tests/bmod_test.ts b/tests/bmod_test.ts index 59517d3..609b13c 100644 --- a/tests/bmod_test.ts +++ b/tests/bmod_test.ts @@ -4,19 +4,19 @@ // .bmod files: packing mods, reading them back, and the server loading a folder of them import { assert, assertEquals, assertRejects, assertStringIncludes, assertThrows } from "@std/assert"; import { zipSync } from "fflate"; -import { ATLAS_BORDER, atlas_layout, extrude_borders } from "$/client/atlas.ts"; -import { MAX_TEXTURE_SIZE } from "$/common/constants.ts"; -import { type Bmod, read_bmod, write_bmod } from "$/common/bmod.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { pack_mod } from "$/tools/pack_mod.ts"; -import { create_mod } from "$/tools/new_mod.ts"; -import { load_bmods } from "$/server/load_bmods.ts"; -import { start_host } from "$/server/host.ts"; +import { ATLAS_BORDER, atlas_layout, extrude_borders } from "@/client/atlas.ts"; +import { MAX_TEXTURE_SIZE } from "@/common/constants.ts"; +import { type Bmod, read_bmod, write_bmod } from "@/common/bmod.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { pack_mod } from "@/tools/pack_mod.ts"; +import { create_mod } from "@/tools/new_mod.ts"; +import { load_bmods } from "@/server/load_bmods.ts"; +import { start_host } from "@/server/host.ts"; import { copy_dir } from "./helpers.ts"; -import { PROTOCOL_VERSION } from "$/common/protocol.ts"; -import { decode_level_chunk, type LevelChunk } from "$/common/chunk_streaming.ts"; -import { decode_chunk, encode_chunk } from "$/server/game/saves.ts"; -import { list_chunks, read_chunk, write_chunks } from "$/server/regions.ts"; +import { PROTOCOL_VERSION } from "@/common/protocol.ts"; +import { decode_level_chunk, type LevelChunk } from "@/common/chunk_streaming.ts"; +import { decode_chunk, encode_chunk } from "@/server/game/saves.ts"; +import { list_chunks, read_chunk, write_chunks } from "@/server/regions.ts"; const ENGINE_TEXTURES = ["cubi:missing", ...Array.from({ length: 9 }, (_, i) => `cubi:break_${i}`)]; diff --git a/tests/chunk_loading.ts b/tests/chunk_loading.ts index b240ad8..4beaa54 100644 --- a/tests/chunk_loading.ts +++ b/tests/chunk_loading.ts @@ -3,8 +3,8 @@ // a game with a worldgen pool, and ticking it like a client loads chunks, for tests/chunk_loading_test.ts and // tools/chunk_loading_bench.ts -import { type WorkerPort, WorldgenPool } from "$/server/game/worldgen_pool.ts"; -import { start_worldgen_workers } from "$/server/worldgen_workers.ts"; +import { type WorkerPort, WorldgenPool } from "@/server/game/worldgen_pool.ts"; +import { start_worldgen_workers } from "@/server/worldgen_workers.ts"; import { test_game } from "./helpers.ts"; // a game whose chunks come from a pool of workers diff --git a/tests/chunk_loading_test.ts b/tests/chunk_loading_test.ts index d0d337b..fb97a0f 100644 --- a/tests/chunk_loading_test.ts +++ b/tests/chunk_loading_test.ts @@ -5,7 +5,7 @@ // gets every chunk around them, the same as the game would make them, without the game generating them itself. see // GameServer.use_worldgen_pool import { assert, assertEquals } from "@std/assert"; -import { is_within_view } from "$/common/chunk_streaming.ts"; +import { is_within_view } from "@/common/chunk_streaming.ts"; import { game_with_pool, load_view } from "./chunk_loading.ts"; // the workers and their ports live until the test closes them diff --git a/tests/chunk_streaming_test.ts b/tests/chunk_streaming_test.ts index fe2a404..5e82395 100644 --- a/tests/chunk_streaming_test.ts +++ b/tests/chunk_streaming_test.ts @@ -4,9 +4,9 @@ // the server sends the world in whole chunks, like minecraft java: nearest first, in batches the client paces, and // only to players who can see them import { assert, assertEquals } from "@std/assert"; -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; -import { decode_level_chunk, encode_level_chunk, is_within_view } from "$/common/chunk_streaming.ts"; -import { PROTOCOL_VERSION } from "$/common/protocol.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; +import { decode_level_chunk, encode_level_chunk, is_within_view } from "@/common/chunk_streaming.ts"; +import { PROTOCOL_VERSION } from "@/common/protocol.ts"; import { sent_block, test_game } from "./helpers.ts"; Deno.test("a chunk comes back as it was encoded, whatever its sections hold", () => { diff --git a/tests/client_data_test.ts b/tests/client_data_test.ts index cce5ba0..38dd23d 100644 --- a/tests/client_data_test.ts +++ b/tests/client_data_test.ts @@ -4,9 +4,9 @@ // the part of a block's tile data clients see: sent with its chunk, then field by field as it changes, saved, and gone // with the block import { assertEquals } from "@std/assert"; -import { chunk_key, ClientLevel } from "$/client/level/client_level.ts"; -import { Visuals } from "$/client/rendering/visuals.ts"; -import { AIR_ID } from "$/common/protocol.ts"; +import { chunk_key, ClientLevel } from "@/client/level/client_level.ts"; +import { Visuals } from "@/client/rendering/visuals.ts"; +import { AIR_ID } from "@/common/protocol.ts"; import { copy_dir, stone_floor, test_game } from "./helpers.ts"; const SHAFT = [1, 99, 1] as const; diff --git a/tests/client_menu_test.ts b/tests/client_menu_test.ts index 3c8bcd6..0e5c336 100644 --- a/tests/client_menu_test.ts +++ b/tests/client_menu_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assertEquals } from "@std/assert"; -import { ClientMenu } from "$/client/menu.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import { ClientMenu } from "@/client/menu.ts"; +import { ItemStack } from "@/common/inventory.ts"; Deno.test("a mod's screen reads its menu's slots as copies", () => { const menu = ClientMenu.opened(1, "testmod:box", "Box", null, [{ x: 0, y: 0 }, { x: 18, y: 0 }]); diff --git a/tests/client_updates_test.ts b/tests/client_updates_test.ts index c699ed5..efdf214 100644 --- a/tests/client_updates_test.ts +++ b/tests/client_updates_test.ts @@ -3,8 +3,8 @@ import { assertEquals } from "@std/assert"; import { join } from "@std/path"; -import { CLIENT_MANIFEST, client_manifest, update_client } from "$/desktop/client_updates.ts"; -import { sha256 } from "$/common/utils.ts"; +import { CLIENT_MANIFEST, client_manifest, update_client } from "@/desktop/client_updates.ts"; +import { sha256 } from "@/common/utils.ts"; const PROTOCOL = 7; diff --git a/tests/commands_test.ts b/tests/commands_test.ts index 668cba6..b2ac280 100644 --- a/tests/commands_test.ts +++ b/tests/commands_test.ts @@ -12,7 +12,7 @@ import { integer, literal, word, -} from "$/common/commands.ts"; +} from "@/common/commands.ts"; import { test_game } from "./helpers.ts"; interface Source { diff --git a/tests/cooking_test.ts b/tests/cooking_test.ts index 010de56..853a9df 100644 --- a/tests/cooking_test.ts +++ b/tests/cooking_test.ts @@ -3,10 +3,10 @@ // farmer's delight's cooking pot: cooks its recipes over a lit furnace, and serves meals into bowls import { assert, assertEquals } from "@std/assert"; -import { ItemStack } from "$/common/inventory.ts"; -import { bake_model } from "$/common/block_models.ts"; -import { validate_recipe } from "$/common/mod_data.ts"; -import { get_state_value, set_state_value } from "$/common/utils.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { bake_model } from "@/common/block_models.ts"; +import { validate_recipe } from "@/common/mod_data.ts"; +import { get_state_value, set_state_value } from "@/common/utils.ts"; import { stone_floor, test_game } from "./helpers.ts"; const POT = [0, 101, 0] as const; diff --git a/tests/crabpot_test.ts b/tests/crabpot_test.ts index 281fbaf..22373fb 100644 --- a/tests/crabpot_test.ts +++ b/tests/crabpot_test.ts @@ -3,13 +3,13 @@ // the crab pot: a block with a model converted from fishermen's trap's fish trap import { assert, assertEquals } from "@std/assert"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { bake_block, type ModelJson } from "$/common/block_models.ts"; -import { shape_at } from "$/common/block_shapes.ts"; -import { get_state_value, set_state_value } from "$/common/utils.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import { CYCLE_TICKS } from "$/common/time.ts"; -import { tag_api } from "$/common/tags.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { bake_block, type ModelJson } from "@/common/block_models.ts"; +import { shape_at } from "@/common/block_shapes.ts"; +import { get_state_value, set_state_value } from "@/common/utils.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { CYCLE_TICKS } from "@/common/time.ts"; +import { tag_api } from "@/common/tags.ts"; import { opened_menu, test_game } from "./helpers.ts"; Deno.test("a crab pot is a box 10 pixels tall and deep, drawn with its textures, turned by its facing", async () => { diff --git a/tests/create/basin_test.ts b/tests/create/basin_test.ts index 6cd3190..62727f9 100644 --- a/tests/create/basin_test.ts +++ b/tests/create/basin_test.ts @@ -4,8 +4,8 @@ // create's basin: items dropped into it go in, a kind to a stack, fluid containers empty into it and fill from it, and // an empty hand takes the items out import { assert, assertEquals } from "@std/assert"; -import { ItemStack } from "$/common/inventory.ts"; -import type { FluidStack, ItemStack as Stack } from "bworld/shared"; +import { ItemStack } from "@/common/inventory.ts"; +import type { FluidStack, ItemStack as Stack } from "cubi/shared"; import { apply_basin_recipe, BASIN_SLOTS, @@ -13,7 +13,7 @@ import { BASIN_TANKS, fill, insert_item, -} from "$/mods/create/scripts/processing/basin.ts"; +} from "@/mods/create/scripts/processing/basin.ts"; import { setup, visual_for } from "./helpers.ts"; const juice = (item: string) => ({ id: "bworld:juice", data: { item } }); diff --git a/tests/create/generators_test.ts b/tests/create/generators_test.ts index 8703169..624c26b 100644 --- a/tests/create/generators_test.ts +++ b/tests/create/generators_test.ts @@ -4,9 +4,9 @@ // create's generators besides the hand crank: the water wheel, turned by water flowing past it, and the creative // motor, which turns at whatever speed it's scrolled to import { assert, assertEquals } from "@std/assert"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { flow_score, motor_step } from "$/mods/create/scripts/kinetics/generators.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { flow_score, motor_step } from "@/mods/create/scripts/kinetics/generators.ts"; import { AXIS, FACING, setup, visual_for } from "./helpers.ts"; // the rpm a generator's params say diff --git a/tests/create/helpers.ts b/tests/create/helpers.ts index 109aba3..bfc617b 100644 --- a/tests/create/helpers.ts +++ b/tests/create/helpers.ts @@ -1,12 +1,12 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { get_state_value, set_state_value } from "$/common/utils.ts"; -import type { Face } from "$/common/mod_api/shared.ts"; -import type { ClientContext, Instances, ModelRef, Visual, VisualBlock } from "$/common/mod_api/client.ts"; -import { setup as setup_client } from "$/mods/create/scripts/client.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { get_state_value, set_state_value } from "@/common/utils.ts"; +import type { Face } from "@/common/mod_api/shared.ts"; +import type { ClientContext, Instances, ModelRef, Visual, VisualBlock } from "@/common/mod_api/client.ts"; +import { setup as setup_client } from "@/mods/create/scripts/client.ts"; import { stone_floor, test_game } from "../helpers.ts"; // facing and axis states, in the order the importer numbers them diff --git a/tests/create/kinetics_test.ts b/tests/create/kinetics_test.ts index a649fc7..65677b6 100644 --- a/tests/create/kinetics_test.ts +++ b/tests/create/kinetics_test.ts @@ -4,7 +4,7 @@ // create's kinetics: shafts take the speed of what turns them, a hand crank turns them while it's being clicked, a // block that would turn two ways at once breaks, and a network that takes more than its generators make stops import { assert, assertEquals } from "@std/assert"; -import { AIR_ID } from "$/common/protocol.ts"; +import { AIR_ID } from "@/common/protocol.ts"; import { test_game } from "../helpers.ts"; import { AXIS, FACING, setup, visual_for } from "./helpers.ts"; diff --git a/tests/create/press_test.ts b/tests/create/press_test.ts index 47ea9e0..6cd1d79 100644 --- a/tests/create/press_test.ts +++ b/tests/create/press_test.ts @@ -5,9 +5,9 @@ // pressing recipes, one at a time, or with a basin under it makes compacting recipes in that, and it only ticks while // it turns import { assert, assertEquals } from "@std/assert"; -import { ItemStack } from "$/common/inventory.ts"; -import { BASIN_TANK_CAPACITY } from "$/mods/create/scripts/processing/basin.ts"; -import { BASIN_TRAVEL, PRESS_AT } from "$/mods/create/scripts/processing/press.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { BASIN_TANK_CAPACITY } from "@/mods/create/scripts/processing/basin.ts"; +import { BASIN_TRAVEL, PRESS_AT } from "@/mods/create/scripts/processing/press.ts"; import { FACING, setup, visual_for } from "./helpers.ts"; // a press at 1 101 0 along x, turned by a crank on its west side, with the floor two blocks under it diff --git a/tests/create/recipes_test.ts b/tests/create/recipes_test.ts index 6d01501..a69c8d5 100644 --- a/tests/create/recipes_test.ts +++ b/tests/create/recipes_test.ts @@ -3,20 +3,20 @@ // create's recipe types: read and checked when the mod loads, and shown by the recipe viewer import { assert, assertEquals, assertThrows } from "@std/assert"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import { tag_api } from "$/common/tags.ts"; -import type { ClientContext } from "$/common/mod_api/client.ts"; -import type { RecipeReader } from "$/common/mod_api/shared.ts"; -import { recipe_lookup } from "$/common/mod_loader.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import { tag_api } from "@/common/tags.ts"; +import type { ClientContext } from "@/common/mod_api/client.ts"; +import type { RecipeReader } from "@/common/mod_api/shared.ts"; +import { recipe_lookup } from "@/common/mod_loader.ts"; import { COMPACTING, parse_processing, PRESSING, processing_type, type ProcessingRecipe, -} from "$/mods/create/scripts/recipes/processing.ts"; -import { inputs, outputs } from "$/mods/recipe_viewer/scripts/recipes.ts"; -import { RecipeIndex } from "$/mods/recipe_viewer/scripts/recipes_screen.ts"; +} from "@/mods/create/scripts/recipes/processing.ts"; +import { inputs, outputs } from "@/mods/recipe_viewer/scripts/recipes.ts"; +import { RecipeIndex } from "@/mods/recipe_viewer/scripts/recipes_screen.ts"; import { test_game } from "../helpers.ts"; const lookup = () => ({ diff --git a/tests/create/transmission_test.ts b/tests/create/transmission_test.ts index 202d939..3bfbd11 100644 --- a/tests/create/transmission_test.ts +++ b/tests/create/transmission_test.ts @@ -4,8 +4,8 @@ // create's blocks that pass rotation on: gearboxes, clutches and gearshifts worked by verdigris, encased shafts and // cogs, and chain drives import { assert, assertEquals } from "@std/assert"; -import { AIR_ID } from "$/common/protocol.ts"; -import { chain_ratio } from "$/mods/create/scripts/kinetics/connections.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { chain_ratio } from "@/mods/create/scripts/kinetics/connections.ts"; import { AXIS, FACING, setup, visual_for } from "./helpers.ts"; // a crank at 0 100 0 facing west, turning a shaft at 1 100 0 along x, and the speed it turns that line at diff --git a/tests/curios_test.ts b/tests/curios_test.ts index 3322f93..0988544 100644 --- a/tests/curios_test.ts +++ b/tests/curios_test.ts @@ -4,9 +4,9 @@ // curios: accessory slots for items in the curios tags, next to the player's inventory, see // mods/bworld/scripts/curios.ts import { assert, assertEquals } from "@std/assert"; -import { PLAYER_MENU_EXTRA, PROTOCOL_VERSION } from "$/common/protocol.ts"; +import { PLAYER_MENU_EXTRA, PROTOCOL_VERSION } from "@/common/protocol.ts"; import { container_items, copy_dir, test_game } from "./helpers.ts"; -import type { WorldSave } from "$/server/game/saves.ts"; +import type { WorldSave } from "@/server/game/saves.ts"; // deno-lint-ignore no-explicit-any type Msg = any; diff --git a/tests/cutting_board_test.ts b/tests/cutting_board_test.ts index 939feb3..ba0cb0f 100644 --- a/tests/cutting_board_test.ts +++ b/tests/cutting_board_test.ts @@ -3,8 +3,8 @@ // farmer's delight's cutting board: holds a stack of anything, shows it on top, and a knife cuts it one at a time import { assert, assertEquals } from "@std/assert"; -import { get_state_value } from "$/common/utils.ts"; -import type { ItemData } from "$/common/inventory.ts"; +import { get_state_value } from "@/common/utils.ts"; +import type { ItemData } from "@/common/inventory.ts"; import { stone_floor, test_game } from "./helpers.ts"; const BOARD = [0, 100, 0] as const; diff --git a/tests/door_test.ts b/tests/door_test.ts index af3a47e..bcc1641 100644 --- a/tests/door_test.ts +++ b/tests/door_test.ts @@ -3,13 +3,13 @@ // doors: two blocks tall, facing the way the player looks, opened from either half, broken as one import { assertEquals } from "@std/assert"; -import { Container, ItemStack } from "$/common/inventory.ts"; -import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts"; -import { shape_at } from "$/common/block_shapes.ts"; -import { bake_block, type ModelJson } from "$/common/block_models.ts"; -import { type BlockRegistry, EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import { get_state_value } from "$/common/utils.ts"; -import { update_crafting_result } from "$/server/game/crafting.ts"; +import { Container, ItemStack } from "@/common/inventory.ts"; +import { CRAFTING_RESULT_SLOT } from "@/common/protocol.ts"; +import { shape_at } from "@/common/block_shapes.ts"; +import { bake_block, type ModelJson } from "@/common/block_models.ts"; +import { type BlockRegistry, EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import { get_state_value } from "@/common/utils.ts"; +import { update_crafting_result } from "@/server/game/crafting.ts"; import { test_game } from "./helpers.ts"; // alice on a stone floor at y 100, south of 0 100 0 and looking north, with oak doors in hand diff --git a/tests/engine_access_test.ts b/tests/engine_access_test.ts index 96f67ac..5594b56 100644 --- a/tests/engine_access_test.ts +++ b/tests/engine_access_test.ts @@ -1,21 +1,21 @@ // SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later -// engine access: mods importing bworld/engine and hooking the engine's methods. see docs/modding/misc/engine.md +// engine access: mods importing cubi/engine and hooking the engine's methods. see docs/modding/misc/engine.md import { assert, assertEquals, assertStringIncludes, assertThrows } from "@std/assert"; -import { clear_hooks, expose_engine, hook, loading_mod } from "$/common/hooks.ts"; -import { GAME_VERSION } from "$/common/constants.ts"; -import { engine_version_problem, validate_manifest } from "$/common/mod_data.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import { read_bmod } from "$/common/bmod.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { pack_mod } from "$/tools/pack_mod.ts"; -import { load_client_mods } from "$/client/mods.ts"; -import { LocalPlayer } from "$/client/entity/local_player.ts"; -import { Options } from "$/client/options.ts"; -import type { Client } from "$/client/client.ts"; -import type { ModListing } from "$/common/mod_loader.ts"; +import { clear_hooks, expose_engine, hook, loading_mod } from "@/common/hooks.ts"; +import { GAME_VERSION } from "@/common/constants.ts"; +import { engine_version_problem, validate_manifest } from "@/common/mod_data.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import { read_bmod } from "@/common/bmod.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { pack_mod } from "@/tools/pack_mod.ts"; +import { load_client_mods } from "@/client/mods.ts"; +import { LocalPlayer } from "@/client/entity/local_player.ts"; +import { Options } from "@/client/options.ts"; +import type { Client } from "@/client/client.ts"; +import type { ModListing } from "@/common/mod_loader.ts"; import { copy_dir, test_game } from "./helpers.ts"; import { game_with_pool } from "./chunk_loading.ts"; @@ -83,7 +83,7 @@ Deno.test("a server mod hooks GameServer to drop twice, like the plan's example" write_mod(dir, "double_drops", { server: [ "server.ts", - `import { engine, hook } from "bworld/engine"; + `import { engine, hook } from "cubi/engine"; export function setup() { hook(engine.server.GameServer.prototype, "pop_item", { after(game, [x, y, z, stack], entity) { @@ -108,7 +108,7 @@ Deno.test("a worldgen mod hooks the terrain in engine.common", async () => { write_mod(dir, "flat_sea", { worldgen: [ "worldgen.ts", - `import { engine, hook } from "bworld/engine"; + `import { engine, hook } from "cubi/engine"; // no ground anywhere, so it's all sea export function setup() { hook(engine.common.OverworldTerrain.prototype, "density", { replace: () => -1 }); @@ -134,7 +134,7 @@ Deno.test({ write_mod(dir, "flat_sea", { worldgen: [ "worldgen.ts", - `import { engine, hook } from "bworld/engine"; + `import { engine, hook } from "cubi/engine"; export function setup() { hook(engine.common.OverworldTerrain.prototype, "density", { replace: () => -1 }); }`, @@ -162,7 +162,7 @@ Deno.test("a client mod hooks LocalPlayer from its .bmod", async () => { write_mod(dir, "floaty", { client: [ "client.ts", - `import { engine, hook } from "bworld/engine"; + `import { engine, hook } from "cubi/engine"; // everyone is a block higher than they think export function setup() { hook(engine.client.LocalPlayer.prototype, "set_position", { @@ -325,7 +325,7 @@ Deno.test("hook needs a loading mod with engine access", async () => { assertThrows(() => hook(new Counter(), "count", {}), Error, "isn't a method"); }); - // importing bworld/engine at all + // importing cubi/engine at all expose_engine({}); const shim = new URL("../common/mod_api/engine.ts", import.meta.url).href; let import_error: Error | undefined; @@ -334,24 +334,24 @@ Deno.test("hook needs a loading mod with engine access", async () => { } catch (e) { import_error = e as Error; } - assertStringIncludes(String(import_error), `sneaky imports bworld/engine without "engine_access"`); + assertStringIncludes(String(import_error), `sneaky imports cubi/engine without "engine_access"`); }); -Deno.test("bworld/engine without engine_access is an error in check-mods and in a .bmod", async () => { +Deno.test("cubi/engine without engine_access is an error in check-mods and in a .bmod", async () => { const dir = Deno.makeTempDirSync({ prefix: "bworld_engine_" }); - const script = `import { engine } from "bworld/engine"; + const script = `import { engine } from "cubi/engine"; export function setup() { console.log(engine.common.physics); }`; write_mod(dir, "sneaky", { server: ["server.ts", script] }, {}); const [mod] = load_and_check(dir); assertEquals(mod.report.errors, [ - `scripts/server.ts imports bworld/engine, which needs "engine_access": true in manifest.json`, + `scripts/server.ts imports cubi/engine, which needs "engine_access": true in manifest.json`, ]); // packed anyway, the bundle gives it away const bytes = await pack_mod(mod); - assertThrows(() => read_bmod(bytes, "sneaky.bmod"), Error, "a script uses bworld/engine"); + assertThrows(() => read_bmod(bytes, "sneaky.bmod"), Error, "a script uses cubi/engine"); Deno.removeSync(dir, { recursive: true }); }); diff --git a/tests/entity_light_test.ts b/tests/entity_light_test.ts index 6d4961c..e170a03 100644 --- a/tests/entity_light_test.ts +++ b/tests/entity_light_test.ts @@ -3,8 +3,8 @@ // entities are lit from the light the chunk worker sends back with each mesh, one byte per block: block << 4 | sky import { assertEquals } from "@std/assert"; -import { BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; +import { BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; import { test_game } from "./helpers.ts"; // the middle chunk's light, with a stone roof at y 20 over x 0-7 and a light block at 12, 5, 8 diff --git a/tests/entity_test.ts b/tests/entity_test.ts index a245501..0d83d57 100644 --- a/tests/entity_test.ts +++ b/tests/entity_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; -import { ItemStack } from "$/common/inventory.ts"; -import { Attribute, ATTRIBUTES } from "$/server/game/entity/attributes.ts"; -import { effect_type, EffectInstance } from "$/server/game/entity/effects.ts"; -import { DAMAGE } from "$/server/game/entity/entity.ts"; -import { register_entity_type } from "$/server/game/entity/entity_types.ts"; -import { Goal, GoalSelector, RandomStrollGoal } from "$/server/game/entity/goals.ts"; -import { Mob } from "$/server/game/entity/mob.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { Attribute, ATTRIBUTES } from "@/server/game/entity/attributes.ts"; +import { effect_type, EffectInstance } from "@/server/game/entity/effects.ts"; +import { DAMAGE } from "@/server/game/entity/entity.ts"; +import { register_entity_type } from "@/server/game/entity/entity_types.ts"; +import { Goal, GoalSelector, RandomStrollGoal } from "@/server/game/entity/goals.ts"; +import { Mob } from "@/server/game/entity/mob.ts"; import { test_game } from "./helpers.ts"; // a mob for testing, walking like a pig diff --git a/tests/farming_test.ts b/tests/farming_test.ts index 3b1010c..da77856 100644 --- a/tests/farming_test.ts +++ b/tests/farming_test.ts @@ -4,9 +4,9 @@ // farming: crops grow one stage every morning at 06:00 if their farmland was watered the day before, like stardew // valley, with minecraft's rules for where crops stand and what they drop import { assert, assertEquals } from "@std/assert"; -import { BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { CYCLE_TICKS } from "$/common/time.ts"; -import { get_state_value } from "$/common/utils.ts"; +import { BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { CYCLE_TICKS } from "@/common/time.ts"; +import { get_state_value } from "@/common/utils.ts"; import { container_items, stone_floor, test_game } from "./helpers.ts"; // deno-lint-ignore no-explicit-any diff --git a/tests/features_test.ts b/tests/features_test.ts index 07e6abb..505d478 100644 --- a/tests/features_test.ts +++ b/tests/features_test.ts @@ -4,12 +4,12 @@ // features are code or data, and use each other: data features with types and modifiers scripts register, scripts // placing data features. they run by step, then mod, data before code. see docs/modding/worldgen/index.md import { assert, assertEquals, assertRejects } from "@std/assert"; -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; import { copy_dir, test_game } from "./helpers.ts"; const SCRIPT = ` -import type { WorldgenContext } from "bworld/worldgen"; +import type { WorldgenContext } from "cubi/worldgen"; export function setup(gen: WorldgenContext) { // a type for data features: a pillar of a block @@ -143,7 +143,7 @@ Deno.test("a data feature whose type no script registers stops the server", asyn Deno.test("a feature can't be both code and data", async () => { const clash = with_mod( { "worldgen/features/glass_pillar.json": GLASS_PILLAR }, - `import type { WorldgenContext } from "bworld/worldgen"; + `import type { WorldgenContext } from "cubi/worldgen"; export function setup(gen: WorldgenContext) { gen.register_feature("testmod:glass_pillar", () => {}); }`, diff --git a/tests/fence_test.ts b/tests/fence_test.ts index 46a1940..e1b3e97 100644 --- a/tests/fence_test.ts +++ b/tests/fence_test.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { Container, ItemStack } from "$/common/inventory.ts"; -import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { bake_block, block_item_texture, type ModelJson } from "$/common/block_models.ts"; -import { collision_shape_at, covers_face, FULL_SHAPE, shape_at } from "$/common/block_shapes.ts"; -import { move_body } from "$/common/physics.ts"; -import { get_state_value } from "$/common/utils.ts"; -import { update_crafting_result } from "$/server/game/crafting.ts"; +import { Container, ItemStack } from "@/common/inventory.ts"; +import { CRAFTING_RESULT_SLOT } from "@/common/protocol.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { bake_block, block_item_texture, type ModelJson } from "@/common/block_models.ts"; +import { collision_shape_at, covers_face, FULL_SHAPE, shape_at } from "@/common/block_shapes.ts"; +import { move_body } from "@/common/physics.ts"; +import { get_state_value } from "@/common/utils.ts"; +import { update_crafting_result } from "@/server/game/crafting.ts"; import { stone_floor, test_game } from "./helpers.ts"; const Y = 100; diff --git a/tests/fishing_test.ts b/tests/fishing_test.ts index 75c3848..d1806f7 100644 --- a/tests/fishing_test.ts +++ b/tests/fishing_test.ts @@ -3,12 +3,12 @@ // fishing: throw the hook into water, wait for a bite, reel it in before it gets away import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; -import { EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import { item_texture } from "$/common/utils.ts"; -import { tag_api } from "$/common/tags.ts"; -import { CYCLE_TICKS } from "$/common/time.ts"; -import { biome_season } from "$/common/worldgen/biomes.ts"; +import { EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { item_texture } from "@/common/utils.ts"; +import { tag_api } from "@/common/tags.ts"; +import { CYCLE_TICKS } from "@/common/time.ts"; +import { biome_season } from "@/common/worldgen/biomes.ts"; import { menu_data, opened_menu, test_game } from "./helpers.ts"; // deno-lint-ignore no-explicit-any diff --git a/tests/fluid_container_test.ts b/tests/fluid_container_test.ts index e7533d6..94dc069 100644 --- a/tests/fluid_container_test.ts +++ b/tests/fluid_container_test.ts @@ -4,9 +4,9 @@ // items that hold one fluid, full or empty: how many stack, what they look like, what they sell for, and turning the // held one into another import { assertEquals } from "@std/assert"; -import { item_tooltip } from "$/client/gui/tooltip.ts"; -import { item_layers } from "$/client/rendering/item_renderer.ts"; -import { ItemStack, sell_value } from "$/common/inventory.ts"; +import { item_tooltip } from "@/client/gui/tooltip.ts"; +import { item_layers } from "@/client/rendering/item_renderer.ts"; +import { ItemStack, sell_value } from "@/common/inventory.ts"; import { copy_dir, test_game } from "./helpers.ts"; const JAR = "testjars:jar"; diff --git a/tests/fluid_flow_test.ts b/tests/fluid_flow_test.ts index 0b38b2a..491ab49 100644 --- a/tests/fluid_flow_test.ts +++ b/tests/fluid_flow_test.ts @@ -3,11 +3,11 @@ // fluids flowing on the server, like minecraft's water: out from a source, down past edges, and draining away import { assert, assertEquals } from "@std/assert"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { get_state_value } from "$/common/utils.ts"; -import { FLUID_DEFAULTS } from "$/common/everything_registry.ts"; -import { FluidFlow } from "$/server/game/fluids.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { get_state_value } from "@/common/utils.ts"; +import { FLUID_DEFAULTS } from "@/common/everything_registry.ts"; +import { FluidFlow } from "@/server/game/fluids.ts"; +import { ItemStack } from "@/common/inventory.ts"; import { test_game } from "./helpers.ts"; type Game = Awaited>["game"]; diff --git a/tests/fluid_handler_test.ts b/tests/fluid_handler_test.ts index f2b8658..f4b94a5 100644 --- a/tests/fluid_handler_test.ts +++ b/tests/fluid_handler_test.ts @@ -4,7 +4,7 @@ // fluid handlers: blocks' from their components, fluid containers', the tanks ctx.fluids.tank_handler keeps for a // script, and pouring from one into another import { assertEquals } from "@std/assert"; -import { item_handler, transfer } from "$/server/game/fluid_handlers.ts"; +import { item_handler, transfer } from "@/server/game/fluid_handlers.ts"; import { copy_dir, stone_floor, test_game } from "./helpers.ts"; const SYRUP = { id: "testmod:syrup" }; @@ -13,7 +13,7 @@ const HONEY = { id: "testmod:honey" }; const JAR = "testmod:jar"; const SERVER_SCRIPT = ` -import type { FluidStack, ServerContext } from "bworld/server"; +import type { FluidStack, ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { // two tanks kept in its data, reached from every side but the bottom ctx.components.register_block("testmod:tank", { diff --git a/tests/fluid_push_test.ts b/tests/fluid_push_test.ts index af7acca..9e88dac 100644 --- a/tests/fluid_push_test.ts +++ b/tests/fluid_push_test.ts @@ -3,7 +3,7 @@ // which way fluid flows and how it pushes what's in it, like minecraft's FlowingFluid.getFlow import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; -import { type Body, fluid_flow, type FluidInCell, push_by_fluid } from "$/common/physics.ts"; +import { type Body, fluid_flow, type FluidInCell, push_by_fluid } from "@/common/physics.ts"; const WATER = "a:water"; diff --git a/tests/fluid_registry_test.ts b/tests/fluid_registry_test.ts index 2a1606a..6c8f5a9 100644 --- a/tests/fluid_registry_test.ts +++ b/tests/fluid_registry_test.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import type { FluidJson } from "$/common/mod_data.ts"; -import type { ModListing } from "$/common/mod_loader.ts"; -import type { FluidApi } from "$/common/mod_api/shared.ts"; -import { read_bmod } from "$/common/bmod.ts"; -import { register_mod_data } from "$/common/mod_loader.ts"; -import { load_client_mods } from "$/client/mods.ts"; -import { fluid_rules } from "$/client/fluid_rules.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { pack_mod } from "$/tools/pack_mod.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import type { FluidJson } from "@/common/mod_data.ts"; +import type { ModListing } from "@/common/mod_loader.ts"; +import type { FluidApi } from "@/common/mod_api/shared.ts"; +import { read_bmod } from "@/common/bmod.ts"; +import { register_mod_data } from "@/common/mod_loader.ts"; +import { load_client_mods } from "@/client/mods.ts"; +import { fluid_rules } from "@/client/fluid_rules.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { pack_mod } from "@/tools/pack_mod.ts"; import { copy_dir, test_game } from "./helpers.ts"; // testfluids: a manifest, the given fluids/ files by file name, and maybe a shared script and an item for it to read @@ -65,7 +65,7 @@ Deno.test("a fluid with a bad color fails loading", () => { // syrup is named after the tree in its data and has the color its data says, sap has no rules const RULES = ` - import type { SharedContext } from "bworld/shared"; + import type { SharedContext } from "cubi/shared"; export function setup(ctx: SharedContext) { ctx.fluids.register("testfluids:syrup", { name: (data: any) => data?.tree && ctx.items.name(data.tree) + " Syrup", diff --git a/tests/fluid_test.ts b/tests/fluid_test.ts index ddbae54..f45ff9b 100644 --- a/tests/fluid_test.ts +++ b/tests/fluid_test.ts @@ -9,13 +9,13 @@ import { fluid_height, fluid_textures, is_fluid_block, -} from "$/common/everything_registry.ts"; -import { block_from_json, block_to_json, type BlockJson, validate_block } from "$/common/mod_data.ts"; -import { cube_face_texture } from "$/common/block_models.ts"; -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; -import { get_state_value, set_state_value } from "$/common/utils.ts"; -import { cell_index, corner_height, fluid_quads, type FluidCell } from "$/client/workers/fluid_mesh.ts"; -import { TERRAIN_VERTEX_BYTES } from "$/client/workers/chunk_messages.ts"; +} from "@/common/everything_registry.ts"; +import { block_from_json, block_to_json, type BlockJson, validate_block } from "@/common/mod_data.ts"; +import { cube_face_texture } from "@/common/block_models.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; +import { get_state_value, set_state_value } from "@/common/utils.ts"; +import { cell_index, corner_height, fluid_quads, type FluidCell } from "@/client/workers/fluid_mesh.ts"; +import { TERRAIN_VERTEX_BYTES } from "@/client/workers/chunk_messages.ts"; import { test_game } from "./helpers.ts"; const OIL: BlockJson = { diff --git a/tests/game_loop_test.ts b/tests/game_loop_test.ts index 8cc423a..b630374 100644 --- a/tests/game_loop_test.ts +++ b/tests/game_loop_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { GameLoop, LoopClock } from "$/server/game/game_loop.ts"; +import { GameLoop, LoopClock } from "@/server/game/game_loop.ts"; // a clock tests move by hand. ticks can move it too, to pretend they were slow class FakeClock implements LoopClock { diff --git a/tests/golden.ts b/tests/golden.ts index 8075c99..1335f19 100644 --- a/tests/golden.ts +++ b/tests/golden.ts @@ -3,10 +3,10 @@ // the golden fixture's hashes, shared by the tests that check generation against it: worldgen_golden_test.ts, // worldgen_bundle_test.ts and worldgen_pool_test.ts. hashed by name, since numeric ids move whenever a block is added -import { AIR, ID_MASK } from "$/common/constants.ts"; -import type { RawChunk } from "$/common/generation.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { sha256 } from "$/common/utils.ts"; +import { AIR, ID_MASK } from "@/common/constants.ts"; +import type { RawChunk } from "@/common/generation.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { sha256 } from "@/common/utils.ts"; export const FIXTURE = new URL("./fixtures/worldgen_golden.json", import.meta.url); export const SEEDS = ["golden-1", "golden-2", "golden-3"]; diff --git a/tests/gui_player_test.ts b/tests/gui_player_test.ts index 092a83d..6928d6e 100644 --- a/tests/gui_player_test.ts +++ b/tests/gui_player_test.ts @@ -3,12 +3,12 @@ // the player in the inventory turns to look at the mouse import { assert, assertEquals } from "@std/assert"; -import { gui_player_faces, gui_player_pose } from "$/client/rendering/gui_player.ts"; -import { AssetManager } from "$/client/assets.ts"; -import type { Texture } from "$/client/renderer/mod.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import { gui_player_faces, gui_player_pose } from "@/client/rendering/gui_player.ts"; +import { AssetManager } from "@/client/assets.ts"; +import type { Texture } from "@/client/renderer/mod.ts"; +import { ItemStack } from "@/common/inventory.ts"; import { test_game } from "./helpers.ts"; -import { part_point, PARTS, pose_to_world } from "$/client/rendering/player_model.ts"; +import { part_point, PARTS, pose_to_world } from "@/client/rendering/player_model.ts"; // where a point of the head or body is, in blocks, the viewer at +z with +x on their right and +y up function where(part_name: "head" | "body", dx: number, dy: number, local: [number, number, number]) { diff --git a/tests/handshake_test.ts b/tests/handshake_test.ts index f9937ec..54907a1 100644 --- a/tests/handshake_test.ts +++ b/tests/handshake_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { PROTOCOL_VERSION } from "$/common/protocol.ts"; -import { TICKS_PER_SECOND } from "$/common/constants.ts"; +import { PROTOCOL_VERSION } from "@/common/protocol.ts"; +import { TICKS_PER_SECOND } from "@/common/constants.ts"; import { test_game } from "./helpers.ts"; Deno.test("a different protocol version is rejected before anything else", async () => { diff --git a/tests/helpers.ts b/tests/helpers.ts index c587e3b..fdbcc56 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -2,23 +2,23 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { resolve, toFileUrl } from "@std/path"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { load_and_check, load_order } from "$/tools/check_mods.ts"; -import { mod_data } from "$/common/mod_check.ts"; -import type { ServerModSource } from "$/server/game/load_mods.ts"; -import { GameServer } from "$/server/game/game_server.ts"; -import { start_game } from "$/server/game/load_mods.ts"; -import { apply_config } from "$/server/load_bmods.ts"; -import { AIR_ID, PROTOCOL_VERSION } from "$/common/protocol.ts"; -import { decode_level_chunk } from "$/common/chunk_streaming.ts"; -import { CHUNK_AREA, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts"; -import type { SavedChunk, SavedChunks, WorldSave } from "$/server/game/saves.ts"; -import { BlockRules } from "$/common/block_rules.ts"; -import { collision_shape_at, covers_face, is_solid } from "$/common/block_shapes.ts"; -import { tag_api } from "$/common/tags.ts"; -import { get_state_value, set_state_value, shared_items_api } from "$/common/utils.ts"; -import type { Face, SharedWorld } from "$/common/mod_api/shared.ts"; -import { setup as setup_shared } from "$/mods/bworld/scripts/shared.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { load_and_check, load_order } from "@/tools/check_mods.ts"; +import { mod_data } from "@/common/mod_check.ts"; +import type { ServerModSource } from "@/server/game/load_mods.ts"; +import { GameServer } from "@/server/game/game_server.ts"; +import { start_game } from "@/server/game/load_mods.ts"; +import { apply_config } from "@/server/load_bmods.ts"; +import { AIR_ID, PROTOCOL_VERSION } from "@/common/protocol.ts"; +import { decode_level_chunk } from "@/common/chunk_streaming.ts"; +import { CHUNK_AREA, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts"; +import type { SavedChunk, SavedChunks, WorldSave } from "@/server/game/saves.ts"; +import { BlockRules } from "@/common/block_rules.ts"; +import { collision_shape_at, covers_face, is_solid } from "@/common/block_shapes.ts"; +import { tag_api } from "@/common/tags.ts"; +import { get_state_value, set_state_value, shared_items_api } from "@/common/utils.ts"; +import type { Face, SharedWorld } from "@/common/mod_api/shared.ts"; +import { setup as setup_shared } from "@/mods/bworld/scripts/shared.ts"; // the repo's own mods/, read once: reading and checking every mod's files is most of starting a game in a test. only // mods/ is kept, since tests change the temporary folders they make between games diff --git a/tests/importer_test.ts b/tests/importer_test.ts index 950256c..8b08a37 100644 --- a/tests/importer_test.ts +++ b/tests/importer_test.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals, assertStringIncludes, assertThrows } from "@std/assert"; -import { validate_block, validate_item, validate_model, validate_recipe } from "$/common/mod_data.ts"; -import type { ModelFileJson } from "$/common/block_models.ts"; -import { import_blocks } from "$/tools/importer/blocks.ts"; -import { import_items } from "$/tools/importer/items.ts"; -import { import_models } from "$/tools/importer/models.ts"; -import { import_recipes } from "$/tools/importer/recipes.ts"; -import { import_tags } from "$/tools/importer/tags.ts"; -import { convert_mcmeta, import_textures } from "$/tools/importer/textures.ts"; +import { validate_block, validate_item, validate_model, validate_recipe } from "@/common/mod_data.ts"; +import type { ModelFileJson } from "@/common/block_models.ts"; +import { import_blocks } from "@/tools/importer/blocks.ts"; +import { import_items } from "@/tools/importer/items.ts"; +import { import_models } from "@/tools/importer/models.ts"; +import { import_recipes } from "@/tools/importer/recipes.ts"; +import { import_tags } from "@/tools/importer/tags.ts"; +import { convert_mcmeta, import_textures } from "@/tools/importer/textures.ts"; // a java mod's resources in a temporary folder: { "block/gear": {...} } is assets//models/block/gear.json function resources(models: Record, namespace = "gears"): string { diff --git a/tests/item_display_test.ts b/tests/item_display_test.ts index d9acae2..1f6489f 100644 --- a/tests/item_display_test.ts +++ b/tests/item_display_test.ts @@ -4,11 +4,11 @@ // items drawn with a model, placed in each place they're shown by the model's display transforms import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; import { mat4 } from "gl-matrix"; -import { display_transform, drawn_as_model, item_model_of } from "$/client/rendering/item_renderer.ts"; -import type { DisplayTransform } from "$/common/block_models.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { create_mod } from "$/tools/new_mod.ts"; +import { display_transform, drawn_as_model, item_model_of } from "@/client/rendering/item_renderer.ts"; +import type { DisplayTransform } from "@/common/block_models.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { create_mod } from "@/tools/new_mod.ts"; import { copy_dir, test_game } from "./helpers.ts"; const HANDLE = { diff --git a/tests/item_entity_test.ts b/tests/item_entity_test.ts index 17260f3..98c6d30 100644 --- a/tests/item_entity_test.ts +++ b/tests/item_entity_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { CRAFTING_RESULT_SLOT, PLAYER_MENU_CRAFTING } from "$/common/protocol.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import { CRAFTING_RESULT_SLOT, PLAYER_MENU_CRAFTING } from "@/common/protocol.ts"; +import { ItemStack } from "@/common/inventory.ts"; import { container_items, test_game } from "./helpers.ts"; // a stone floor at y 99 so drops have something to land on, high above the generated terrain diff --git a/tests/item_model_test.ts b/tests/item_model_test.ts index 41eec3c..68691cb 100644 --- a/tests/item_model_test.ts +++ b/tests/item_model_test.ts @@ -3,8 +3,8 @@ // dropped items are drawn 3d like minecraft's: the sprite front and back, and a side face on every exposed pixel edge import { assert, assertEquals } from "@std/assert"; -import { extrude_item, type ItemQuad } from "$/client/rendering/item_model.ts"; -import { TEXTURE_SIZE } from "$/common/constants.ts"; +import { extrude_item, type ItemQuad } from "@/client/rendering/item_model.ts"; +import { TEXTURE_SIZE } from "@/common/constants.ts"; function mask(pixels: [number, number][], width = TEXTURE_SIZE, height = TEXTURE_SIZE) { const mask = new Uint8Array(width * height); diff --git a/tests/juice_test.ts b/tests/juice_test.ts index 0a3f53d..8697143 100644 --- a/tests/juice_test.ts +++ b/tests/juice_test.ts @@ -3,18 +3,18 @@ // juice: one fluid named, colored and valued after the bworld:juiceable item in its data, and the juicer that makes it import { assert, assertEquals, assertRejects } from "@std/assert"; -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import type { FluidJson } from "$/common/mod_data.ts"; -import type { ClientContext, Instances, Visual, VisualBlock } from "$/common/mod_api/client.ts"; -import { CHUNK_AREA, CHUNK_SIZE } from "$/common/constants.ts"; -import { block_value, display_name } from "$/common/utils.ts"; -import { sell_value } from "$/common/inventory.ts"; -import { block_visuals, Visuals } from "$/client/rendering/visuals.ts"; -import { AssetManager } from "$/client/assets.ts"; -import { fluid_rules, set_fluid_rules } from "$/client/fluid_rules.ts"; -import { setup as setup_client } from "$/mods/bworld/scripts/client.ts"; -import { JUICE_VALUE, type JuiceableParams, WINE_VALUE } from "$/mods/bworld/scripts/shared.ts"; -import type { FermentableRecipe } from "$/mods/bworld/scripts/fermenting.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import type { FluidJson } from "@/common/mod_data.ts"; +import type { ClientContext, Instances, Visual, VisualBlock } from "@/common/mod_api/client.ts"; +import { CHUNK_AREA, CHUNK_SIZE } from "@/common/constants.ts"; +import { block_value, display_name } from "@/common/utils.ts"; +import { sell_value } from "@/common/inventory.ts"; +import { block_visuals, Visuals } from "@/client/rendering/visuals.ts"; +import { AssetManager } from "@/client/assets.ts"; +import { fluid_rules, set_fluid_rules } from "@/client/fluid_rules.ts"; +import { setup as setup_client } from "@/mods/bworld/scripts/client.ts"; +import { JUICE_VALUE, type JuiceableParams, WINE_VALUE } from "@/mods/bworld/scripts/shared.ts"; +import type { FermentableRecipe } from "@/mods/bworld/scripts/fermenting.ts"; import { copy_dir, stone_floor, test_game } from "./helpers.ts"; const CLOUDBERRY = "testberries:cloudberry"; diff --git a/tests/keg_test.ts b/tests/keg_test.ts index 2770bba..31fd1c7 100644 --- a/tests/keg_test.ts +++ b/tests/keg_test.ts @@ -3,9 +3,9 @@ // the keg's input and output tanks, and menus' fluid slots, which its screen shows them in import { assertEquals } from "@std/assert"; -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import { ItemStack } from "$/common/inventory.ts"; -import type { FermentableRecipe } from "$/mods/bworld/scripts/fermenting.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import { ItemStack } from "@/common/inventory.ts"; +import type { FermentableRecipe } from "@/mods/bworld/scripts/fermenting.ts"; import { opened_menu, test_game } from "./helpers.ts"; const JUICE = { id: "bworld:juice" }; diff --git a/tests/local_player_test.ts b/tests/local_player_test.ts index 6ac48a4..a1e11f1 100644 --- a/tests/local_player_test.ts +++ b/tests/local_player_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertAlmostEquals, assertEquals, assertFalse } from "@std/assert"; -import { LocalPlayer } from "$/client/entity/local_player.ts"; -import { InputManager } from "$/client/input_manager.ts"; -import { Options } from "$/client/options.ts"; -import type { Client } from "$/client/client.ts"; +import { LocalPlayer } from "@/client/entity/local_player.ts"; +import { InputManager } from "@/client/input_manager.ts"; +import { Options } from "@/client/options.ts"; +import type { Client } from "@/client/client.ts"; type Blocks = (x: number, y: number, z: number) => boolean; diff --git a/tests/loot_test.ts b/tests/loot_test.ts index 7227f22..f7edd61 100644 --- a/tests/loot_test.ts +++ b/tests/loot_test.ts @@ -3,7 +3,7 @@ // loot tables: rolling them, checking them, and the game using them for blocks, mobs and scripts import { assert, assertEquals, assertThrows } from "@std/assert"; -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; import { type BaseLootContext, type LootEnvironment, @@ -11,11 +11,11 @@ import { number, roll_loot, validate_loot_table, -} from "$/common/loot.ts"; -import { Tags } from "$/common/tags.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { create_entity } from "$/server/game/entity/entity_types.ts"; -import type { LivingEntity } from "$/server/game/entity/living_entity.ts"; +} from "@/common/loot.ts"; +import { Tags } from "@/common/tags.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { create_entity } from "@/server/game/entity/entity_types.ts"; +import type { LivingEntity } from "@/server/game/entity/living_entity.ts"; import { copy_dir, test_game } from "./helpers.ts"; // the tables, registered fresh, with a tool and a tag to match @@ -232,7 +232,7 @@ function loot_mod(dir: string) { Deno.mkdirSync(`${mod}/scripts`); Deno.writeTextFileSync( `${mod}/scripts/server.ts`, - `import type { ServerContext } from "bworld/server"; + `import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { ctx.loot.register_condition("testloot:high", (_params, context) => (context.position?.y ?? 0) > 120); ctx.loot.register_function("testloot:double", (item) => ({ ...item, count: item.count * 2 })); diff --git a/tests/machines_test.ts b/tests/machines_test.ts index 175eb99..b784db5 100644 --- a/tests/machines_test.ts +++ b/tests/machines_test.ts @@ -4,13 +4,13 @@ // what machines do to the world through server scripts: read which way water flows, find items lying around and // change them, push things, break blocks over time, and use items on blocks like a player would import { assert, assertEquals, assertThrows } from "@std/assert"; -import type { ServerContext } from "bworld/server"; -import { AIR_ID } from "$/common/protocol.ts"; +import type { ServerContext } from "cubi/server"; +import { AIR_ID } from "@/common/protocol.ts"; import { copy_dir, stone_floor, test_game } from "./helpers.ts"; // hands the test its context, and has a block that says who right clicked it and an item that gives a stick when used const SERVER_SCRIPT = ` -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { (globalThis as any).machines_ctx = ctx; ctx.components.register_block("testmod:button", { diff --git a/tests/mod_config_test.ts b/tests/mod_config_test.ts index acff6ef..1ebbe0f 100644 --- a/tests/mod_config_test.ts +++ b/tests/mod_config_test.ts @@ -3,11 +3,11 @@ // mods' config.json: their settings, which servers and tests can change, see docs/modding/misc/config.md import { assert, assertEquals, assertRejects } from "@std/assert"; -import { read_bmod, write_bmod } from "$/common/bmod.ts"; -import type { ModData } from "$/common/mod_loader.ts"; -import { apply_config, load_bmods } from "$/server/load_bmods.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { create_mod } from "$/tools/new_mod.ts"; +import { read_bmod, write_bmod } from "@/common/bmod.ts"; +import type { ModData } from "@/common/mod_loader.ts"; +import { apply_config, load_bmods } from "@/server/load_bmods.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { create_mod } from "@/tools/new_mod.ts"; import { copy_dir, test_game } from "./helpers.ts"; const config_file = (config: unknown) => JSON.stringify({ format_version: 1, config }); @@ -38,7 +38,7 @@ Deno.test("a server script reads its mod's config, with the changes a test makes create_mod("copper_tools", "Copper Tools", dir); Deno.writeTextFileSync( `${dir}/copper_tools/scripts/server.ts`, - `import type { ServerContext } from "bworld/server"; + `import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { ctx.components.register_block("copper_tools:announce", {}); ctx.commands.register("settings", { diff --git a/tests/mod_entity_test.ts b/tests/mod_entity_test.ts index b507577..f87448a 100644 --- a/tests/mod_entity_test.ts +++ b/tests/mod_entity_test.ts @@ -3,9 +3,9 @@ // mobs mods define in entities/.json, drawn with a bedrock model from models/.geo.json import { assert, assertEquals, assertStringIncludes } from "@std/assert"; -import { entity_model_from_geo, validate_entity } from "$/common/mod_data.ts"; -import { Mob } from "$/server/game/entity/mob.ts"; -import { create_entity } from "$/server/game/entity/entity_types.ts"; +import { entity_model_from_geo, validate_entity } from "@/common/mod_data.ts"; +import { Mob } from "@/server/game/entity/mob.ts"; +import { create_entity } from "@/server/game/entity/entity_types.ts"; import { container_items, test_game } from "./helpers.ts"; Deno.test("a bedrock geo.json becomes an entity model with only what the engine uses", () => { diff --git a/tests/mod_loading_test.ts b/tests/mod_loading_test.ts index 0bfb810..7785a55 100644 --- a/tests/mod_loading_test.ts +++ b/tests/mod_loading_test.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { AIR, CHUNK_HEIGHT } from "$/common/constants.ts"; -import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; -import { block_from_json, block_to_json, item_from_json, item_to_json } from "$/common/mod_data.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; -import { block_variant } from "$/common/block_models.ts"; -import { load_worldgen } from "$/common/worldgen_loader.ts"; -import { create_mod } from "$/tools/new_mod.ts"; -import { PLAYER_MENU_CRAFTING, PROTOCOL_VERSION } from "$/common/protocol.ts"; -import { recipe_lookup } from "$/common/mod_loader.ts"; +import { AIR, CHUNK_HEIGHT } from "@/common/constants.ts"; +import { BlockRegistry, EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts"; +import { block_from_json, block_to_json, item_from_json, item_to_json } from "@/common/mod_data.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; +import { block_variant } from "@/common/block_models.ts"; +import { load_worldgen } from "@/common/worldgen_loader.ts"; +import { create_mod } from "@/tools/new_mod.ts"; +import { PLAYER_MENU_CRAFTING, PROTOCOL_VERSION } from "@/common/protocol.ts"; +import { recipe_lookup } from "@/common/mod_loader.ts"; import { container_items, copy_dir, test_game } from "./helpers.ts"; // mods/bworld plus a mod made from the template, in a temp folder @@ -202,7 +202,7 @@ Deno.test("mod storage and block data are saved with the world", async () => { // a server script that uses storage and block data Deno.writeTextFileSync( `${dir}/copper_tools/scripts/server.ts`, - `import type { ServerContext } from "bworld/server"; + `import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { ctx.components.register_block("copper_tools:announce", { on_create(block) { block.data = { placed_at: ctx.system.current_tick }; }, diff --git a/tests/mod_tools_test.ts b/tests/mod_tools_test.ts index f2276fe..a7b8ac7 100644 --- a/tests/mod_tools_test.ts +++ b/tests/mod_tools_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals, assertThrows } from "@std/assert"; -import { check_mods } from "$/tools/check_mods.ts"; -import { MAX_TEXTURE_SIZE } from "$/common/constants.ts"; -import { create_mod } from "$/tools/new_mod.ts"; -import { item_from_json, item_to_json } from "$/common/mod_data.ts"; +import { check_mods } from "@/tools/check_mods.ts"; +import { MAX_TEXTURE_SIZE } from "@/common/constants.ts"; +import { create_mod } from "@/tools/new_mod.ts"; +import { item_from_json, item_to_json } from "@/common/mod_data.ts"; function temp_mods_dir() { const dir = Deno.makeTempDirSync({ prefix: "bworld_mods_" }); diff --git a/tests/model_parents_test.ts b/tests/model_parents_test.ts index 8ba26a9..7fe19bd 100644 --- a/tests/model_parents_test.ts +++ b/tests/model_parents_test.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { BUILTIN_MODELS, type ModelJson, resolve_models, resolve_texture } from "$/common/block_models.ts"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import { validate_model } from "$/common/mod_data.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { create_mod } from "$/tools/new_mod.ts"; +import { BUILTIN_MODELS, type ModelJson, resolve_models, resolve_texture } from "@/common/block_models.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import { validate_model } from "@/common/mod_data.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { create_mod } from "@/tools/new_mod.ts"; import { copy_dir, test_game } from "./helpers.ts"; const BOX = { from: [0, 0, 0], to: [16, 8, 16], faces: { top: { texture: "#top" } } } as ModelJson["elements"][0]; diff --git a/tests/monster_test.ts b/tests/monster_test.ts index 87a54d1..53fb4c6 100644 --- a/tests/monster_test.ts +++ b/tests/monster_test.ts @@ -3,8 +3,8 @@ // "monster" entities go after players and whoever hurts them, like undergarden's rotwalker, see mods/undergarden import { assert, assertEquals } from "@std/assert"; -import { create_entity } from "$/server/game/entity/entity_types.ts"; -import { Mob } from "$/server/game/entity/mob.ts"; +import { create_entity } from "@/server/game/entity/entity_types.ts"; +import { Mob } from "@/server/game/entity/mob.ts"; import { stone_floor, test_game } from "./helpers.ts"; // a stone floor with alice on it, and a rotwalker 3 blocks away diff --git a/tests/natural_spawn_test.ts b/tests/natural_spawn_test.ts index 1a40454..127b53a 100644 --- a/tests/natural_spawn_test.ts +++ b/tests/natural_spawn_test.ts @@ -4,18 +4,18 @@ // monsters spawning on their own in the dark near players, like undergarden's rotwalkers, see natural_spawner.ts and // mods/undergarden/worldgen/spawns.json import { assert, assertEquals } from "@std/assert"; -import { CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; -import { decode_level_chunk } from "$/common/chunk_streaming.ts"; +import { CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; +import { decode_level_chunk } from "@/common/chunk_streaming.ts"; import { block_light_emission, block_light_opacity, BlockRegistry, EverythingRegistry, -} from "$/common/everything_registry.ts"; -import { LightRegion, REGION_LAYER, REGION_SIZE, REGION_VOID } from "$/client/workers/lighting.ts"; -import { create_entity } from "$/server/game/entity/entity_types.ts"; -import { Mob } from "$/server/game/entity/mob.ts"; -import { NaturalSpawner } from "$/server/game/natural_spawner.ts"; +} from "@/common/everything_registry.ts"; +import { LightRegion, REGION_LAYER, REGION_SIZE, REGION_VOID } from "@/client/workers/lighting.ts"; +import { create_entity } from "@/server/game/entity/entity_types.ts"; +import { Mob } from "@/server/game/entity/mob.ts"; +import { NaturalSpawner } from "@/server/game/natural_spawner.ts"; import { test_game } from "./helpers.ts"; // chunk 6, 6: a closed stone room with its floor at y 60 and its roof at y 64, and alice standing 40 blocks away. diff --git a/tests/neighbor_hooks_test.ts b/tests/neighbor_hooks_test.ts index 582f7e5..6a8762f 100644 --- a/tests/neighbor_hooks_test.ts +++ b/tests/neighbor_hooks_test.ts @@ -4,14 +4,14 @@ // the server's side of a block hearing about changes: its components' on_neighbor_change, after the shared rules, and // on_state_change when its own states change. blocks hear of changes through a queue, once the change is done import { assert, assertEquals } from "@std/assert"; -import { AIR_ID } from "$/common/protocol.ts"; -import { MAX_NEIGHBOR_UPDATES } from "$/common/block_rules.ts"; -import { get_state_value } from "$/common/utils.ts"; -import type { GameServer } from "$/server/game/game_server.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { MAX_NEIGHBOR_UPDATES } from "@/common/block_rules.ts"; +import { get_state_value } from "@/common/utils.ts"; +import type { GameServer } from "@/server/game/game_server.ts"; import { copy_dir, stone_floor, test_game } from "./helpers.ts"; const SERVER_SCRIPT = ` -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { const log = (event: unknown[]) => ctx.storage.set("log", [...ctx.storage.get("log") ?? [], event]); const at = ({ x, y, z }: { x: number; y: number; z: number }) => x + " " + y + " " + z; @@ -56,7 +56,7 @@ export function setup(ctx: ServerContext) { `; const SHARED_SCRIPT = ` -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export function setup(ctx: SharedContext) { // marks the watcher once anything beside it changes ctx.components.register_block("testmod:watcher", { diff --git a/tests/physics_test.ts b/tests/physics_test.ts index 0c59214..bf4dcb7 100644 --- a/tests/physics_test.ts +++ b/tests/physics_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; -import { eyes_in_water, in_water, move_body } from "$/common/physics.ts"; -import { type BlockRegistry, FLUID_DEFAULTS, is_fluid_block } from "$/common/everything_registry.ts"; +import { eyes_in_water, in_water, move_body } from "@/common/physics.ts"; +import { type BlockRegistry, FLUID_DEFAULTS, is_fluid_block } from "@/common/everything_registry.ts"; const body = (x: number, z: number, vx: number, vz: number) => ({ x, y: 0, z, vx, vy: 0, vz, width: 0.6, height: 1.8 }); // a block at x 0 to 1, z 1 to 2, on a floor diff --git a/tests/player_actions_test.ts b/tests/player_actions_test.ts index 20c01fa..afe1599 100644 --- a/tests/player_actions_test.ts +++ b/tests/player_actions_test.ts @@ -3,11 +3,11 @@ // what players do with their hands: sneaking while placing and using, how far they reach, and using an item over time import { assert, assertEquals } from "@std/assert"; -import { ATTRIBUTES } from "$/server/game/entity/attributes.ts"; +import { ATTRIBUTES } from "@/server/game/entity/attributes.ts"; import { copy_dir, stone_floor, test_game } from "./helpers.ts"; const SERVER_SCRIPT = ` -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { const log = (key: string, value: unknown = 1) => { const all = ctx.storage.get>("log") ?? {}; @@ -40,7 +40,7 @@ export function setup(ctx: ServerContext) { // a pillar placed upside down while sneaking, like a block whose placement reads sneaking const SHARED_SCRIPT = ` -import type { SharedContext } from "bworld/shared"; +import type { SharedContext } from "cubi/shared"; export function setup(ctx: SharedContext) { ctx.components.register_block("testmod:pillar", { state_for_placement(placement) { return { flipped: placement.sneaking ? 1 : 0 }; }, diff --git a/tests/recipe_viewer_test.ts b/tests/recipe_viewer_test.ts index f992671..f2f124c 100644 --- a/tests/recipe_viewer_test.ts +++ b/tests/recipe_viewer_test.ts @@ -6,10 +6,10 @@ import { assert, assertEquals } from "@std/assert"; import { category_name, type RecipeLayout } from "../mods/recipe_viewer/scripts/categories.ts"; import { inputs as recipe_inputs, outputs } from "../mods/recipe_viewer/scripts/recipes.ts"; import { RecipeIndex } from "../mods/recipe_viewer/scripts/recipes_screen.ts"; -import { tag_api } from "$/common/tags.ts"; -import { FluidRules } from "$/common/fluids.ts"; -import { type BlockRegistry, EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import type { ClientContext } from "bworld/client"; +import { tag_api } from "@/common/tags.ts"; +import { FluidRules } from "@/common/fluids.ts"; +import { type BlockRegistry, EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import type { ClientContext } from "cubi/client"; import { test_game } from "./helpers.ts"; const ids = (ingredients: { ids: string[] }[]) => ingredients.map((i) => i.ids.join("|")); diff --git a/tests/scheduled_ticks_test.ts b/tests/scheduled_ticks_test.ts index 3ab2b45..948747f 100644 --- a/tests/scheduled_ticks_test.ts +++ b/tests/scheduled_ticks_test.ts @@ -3,12 +3,12 @@ // ticks blocks schedule ahead with ctx.world.schedule_tick: when and in what order they run, and that they last import { assert, assertEquals } from "@std/assert"; -import { ScheduledTicks } from "$/server/game/scheduled_ticks.ts"; -import type { WorldSave } from "$/server/game/saves.ts"; +import { ScheduledTicks } from "@/server/game/scheduled_ticks.ts"; +import type { WorldSave } from "@/server/game/saves.ts"; import { copy_dir, stone_floor, test_game } from "./helpers.ts"; const SERVER_SCRIPT = ` -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { const log = (event: unknown[]) => ctx.storage.set("log", [...ctx.storage.get("log") ?? [], event]); ctx.components.register_block("testmod:clock", { diff --git a/tests/script_recipes_test.ts b/tests/script_recipes_test.ts index b7a7065..b015907 100644 --- a/tests/script_recipes_test.ts +++ b/tests/script_recipes_test.ts @@ -4,19 +4,19 @@ // recipes a shared script registers with ctx.recipes.register: there on the server and every client alike, for their // scripts and the crafting grid, without being sent import { assert, assertEquals, assertRejects } from "@std/assert"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import type { ModListing } from "$/common/mod_loader.ts"; -import { read_bmod } from "$/common/bmod.ts"; -import { load_client_mods } from "$/client/mods.ts"; -import { load_order } from "$/common/mod_check.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { pack_mod } from "$/tools/pack_mod.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import type { ModListing } from "@/common/mod_loader.ts"; +import { read_bmod } from "@/common/bmod.ts"; +import { load_client_mods } from "@/client/mods.ts"; +import { load_order } from "@/common/mod_check.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { pack_mod } from "@/tools/pack_mod.ts"; import { copy_dir, test_game } from "./helpers.ts"; // sifts into what its component says, and a shaped recipe made in code. then sifting and washing as testrecipes' own // types, found by the item put in const SHARED = ` - import type { SharedContext } from "bworld/shared"; + import type { SharedContext } from "cubi/shared"; export function setup(ctx: SharedContext) { for (const id of ctx.items.ids()) { const sifts = ctx.items.components(id)["testrecipes:siftable"] as { into: string } | undefined; diff --git a/tests/season_test.ts b/tests/season_test.ts index 4c3e43f..405b0b6 100644 --- a/tests/season_test.ts +++ b/tests/season_test.ts @@ -3,12 +3,12 @@ // blocks, entities, players and the world tell scripts their biome's season, see docs/modding/worldgen/biomes.md import { assertEquals } from "@std/assert"; -import type { ServerContext } from "$/common/mod_api/server.ts"; -import { get_biome } from "$/common/worldgen/biomes.ts"; +import type { ServerContext } from "@/common/mod_api/server.ts"; +import { get_biome } from "@/common/worldgen/biomes.ts"; import { copy_dir, test_game } from "./helpers.ts"; const SCRIPT = ` -import type { ServerContext } from "bworld/server"; +import type { ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { (globalThis as any).season_test = { ctx, created: [] }; diff --git a/tests/server_address_test.ts b/tests/server_address_test.ts index aa371ea..1d23382 100644 --- a/tests/server_address_test.ts +++ b/tests/server_address_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assertEquals, assertThrows } from "@std/assert"; -import { server_address } from "$/client/handshake.ts"; +import { server_address } from "@/client/handshake.ts"; const DESKTOP_PAGE = new URL("http://127.0.0.1:33549/client/"); const HTTPS_PAGE = new URL("https://bworld.moder.fans/client/"); diff --git a/tests/server_scripts_test.ts b/tests/server_scripts_test.ts index fe7fff3..aeddd92 100644 --- a/tests/server_scripts_test.ts +++ b/tests/server_scripts_test.ts @@ -3,11 +3,11 @@ import { assert, assertEquals } from "@std/assert"; import { copy_dir, menu_data, menu_items, opened_menu, sent_block, test_game } from "./helpers.ts"; -import type { WorldSave } from "$/server/game/saves.ts"; +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 "bworld/server"; +import type { BlockRef, ServerContext } from "cubi/server"; export function setup(ctx: ServerContext) { const log = (key: string, value: unknown = 1) => { const all = ctx.storage.get>("log") ?? {}; diff --git a/tests/shared_rules_test.ts b/tests/shared_rules_test.ts index 139a800..65681c6 100644 --- a/tests/shared_rules_test.ts +++ b/tests/shared_rules_test.ts @@ -4,9 +4,9 @@ // shared scripts' block rules run on clients too, so what a client shows the moment it places, breaks or right clicks // a block is what the server ends up with import { assertEquals } from "@std/assert"; -import { AIR_ID } from "$/common/protocol.ts"; -import { get_state_value } from "$/common/utils.ts"; -import type { Face } from "$/common/mod_api/shared.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { get_state_value } from "@/common/utils.ts"; +import type { Face } from "@/common/mod_api/shared.ts"; import { type Area, client_of, server_blocks, test_game } from "./helpers.ts"; type Game = Awaited>; diff --git a/tests/shift_click_test.ts b/tests/shift_click_test.ts index da00e76..4e832c2 100644 --- a/tests/shift_click_test.ts +++ b/tests/shift_click_test.ts @@ -3,7 +3,7 @@ // shift clicking a slot moves its stack to the other part of the screen, like minecraft's quick move import { assertEquals } from "@std/assert"; -import { CRAFTING_RESULT_SLOT, PLAYER_MENU_CRAFTING } from "$/common/protocol.ts"; +import { CRAFTING_RESULT_SLOT, PLAYER_MENU_CRAFTING } from "@/common/protocol.ts"; import { container_items, menu_items, opened_menu, stone_floor, test_game } from "./helpers.ts"; // deno-lint-ignore no-explicit-any diff --git a/tests/skin_test.ts b/tests/skin_test.ts index b2f148d..a8150de 100644 --- a/tests/skin_test.ts +++ b/tests/skin_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assertEquals } from "@std/assert"; -import { encode_skin } from "$/server/game/skins.ts"; -import { PROTOCOL_VERSION } from "$/common/protocol.ts"; +import { encode_skin } from "@/server/game/skins.ts"; +import { PROTOCOL_VERSION } from "@/common/protocol.ts"; import { test_game } from "./helpers.ts"; const SKIN = Deno.readFileSync("assets/sprites/skin_template.png"); diff --git a/tests/smelting_test.ts b/tests/smelting_test.ts index c4e67bd..4acabe7 100644 --- a/tests/smelting_test.ts +++ b/tests/smelting_test.ts @@ -3,7 +3,7 @@ // the base game's bworld:smelting and bworld:fuel recipes, as another mod adding to them sees them import { assertEquals, assertRejects } from "@std/assert"; -import { recipe_lookup } from "$/common/mod_loader.ts"; +import { recipe_lookup } from "@/common/mod_loader.ts"; import { copy_dir, test_game } from "./helpers.ts"; // the base game, and a mod after it with these recipes diff --git a/tests/stack_data_test.ts b/tests/stack_data_test.ts index 5e53a51..ae741be 100644 --- a/tests/stack_data_test.ts +++ b/tests/stack_data_test.ts @@ -3,7 +3,7 @@ // stacks of one item only merge when their data is the same, whatever order its keys are in import { assertEquals } from "@std/assert"; -import { click_slot, Container, type Cursor, ItemStack, LEFT_CLICK } from "$/common/inventory.ts"; +import { click_slot, Container, type Cursor, ItemStack, LEFT_CLICK } from "@/common/inventory.ts"; import { test_game } from "./helpers.ts"; const coal = (count: number, data?: unknown) => { diff --git a/tests/swimming_test.ts b/tests/swimming_test.ts index 5c7db60..694fa67 100644 --- a/tests/swimming_test.ts +++ b/tests/swimming_test.ts @@ -4,8 +4,8 @@ // swimming as the server sees it: each player's client says when they're swimming, which gives them the short box // and low eyes, and tells everyone else. how they swim is the client's, see local_player_test.ts import { assert, assertAlmostEquals, assertEquals, assertNotEquals } from "@std/assert"; -import { PLAYER_EYE_HEIGHT, PLAYER_HEIGHT, PLAYER_SWIM_EYE_HEIGHT, PLAYER_SWIM_HEIGHT } from "$/common/constants.ts"; -import { part_point, PARTS, type PlayerPose, pose_at, pose_to_world } from "$/client/rendering/player_model.ts"; +import { PLAYER_EYE_HEIGHT, PLAYER_HEIGHT, PLAYER_SWIM_EYE_HEIGHT, PLAYER_SWIM_HEIGHT } from "@/common/constants.ts"; +import { part_point, PARTS, type PlayerPose, pose_at, pose_to_world } from "@/client/rendering/player_model.ts"; import { test_game } from "./helpers.ts"; // deno-lint-ignore no-explicit-any diff --git a/tests/tags_test.ts b/tests/tags_test.ts index eeb9a42..4f471c0 100644 --- a/tests/tags_test.ts +++ b/tests/tags_test.ts @@ -3,15 +3,15 @@ // tags: lists of blocks, items, entities or biomes that every mod can add to, see docs/modding/resources/tags.md import { assert, assertEquals, assertThrows } from "@std/assert"; -import { Container, ItemStack } from "$/common/inventory.ts"; -import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import type { ManifestJson, TagJson } from "$/common/mod_data.ts"; -import { resolve_tags, tag_api, type TagSource } from "$/common/tags.ts"; -import { can_stand_on } from "$/common/utils.ts"; -import { read_bmod, write_bmod } from "$/common/bmod.ts"; -import { update_crafting_result } from "$/server/game/crafting.ts"; -import { check_mods } from "$/tools/check_mods.ts"; +import { Container, ItemStack } from "@/common/inventory.ts"; +import { CRAFTING_RESULT_SLOT } from "@/common/protocol.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import type { ManifestJson, TagJson } from "@/common/mod_data.ts"; +import { resolve_tags, tag_api, type TagSource } from "@/common/tags.ts"; +import { can_stand_on } from "@/common/utils.ts"; +import { read_bmod, write_bmod } from "@/common/bmod.ts"; +import { update_crafting_result } from "@/server/game/crafting.ts"; +import { check_mods } from "@/tools/check_mods.ts"; import { copy_dir, test_game } from "./helpers.ts"; // tag files in load order, all item tags unless they say otherwise diff --git a/tests/terrain_culling_test.ts b/tests/terrain_culling_test.ts index a92e85e..0c9ab02 100644 --- a/tests/terrain_culling_test.ts +++ b/tests/terrain_culling_test.ts @@ -5,11 +5,11 @@ // would have shown import { assert, assertEquals } from "@std/assert"; import { mat4 } from "gl-matrix"; -import { BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { Frustum } from "$/client/rendering/frustum.ts"; -import { group_faces_camera } from "$/client/rendering/level_renderer.ts"; -import { FACE_GROUPS, type LayerMesh, TERRAIN_VERTEX_BYTES } from "$/client/workers/chunk_messages.ts"; -import { decode_level_chunk } from "$/common/chunk_streaming.ts"; +import { BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { Frustum } from "@/client/rendering/frustum.ts"; +import { group_faces_camera } from "@/client/rendering/level_renderer.ts"; +import { FACE_GROUPS, type LayerMesh, TERRAIN_VERTEX_BYTES } from "@/client/workers/chunk_messages.ts"; +import { decode_level_chunk } from "@/common/chunk_streaming.ts"; import { test_game } from "./helpers.ts"; // the matrix the renderer makes for a camera, see update_camera in client/renderer/core.ts diff --git a/tests/terrain_data_test.ts b/tests/terrain_data_test.ts index c354925..b1cd36f 100644 --- a/tests/terrain_data_test.ts +++ b/tests/terrain_data_test.ts @@ -4,8 +4,8 @@ // the terrain is data: noises, density functions, noise settings and biome sources in mods' worldgen folders, see // docs/modding/worldgen/terrain.md. tests/worldgen_golden_test.ts checks the base game's makes the same world import { assert, assertEquals, assertRejects } from "@std/assert"; -import { CHUNK_AREA } from "$/common/constants.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; +import { CHUNK_AREA } from "@/common/constants.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; import { copy_dir, test_game } from "./helpers.ts"; // mods/bworld and a mod with files, in a temp folder diff --git a/tests/text_input_test.ts b/tests/text_input_test.ts index 62c8977..0c680cb 100644 --- a/tests/text_input_test.ts +++ b/tests/text_input_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assertEquals } from "@std/assert"; -import { TextInput } from "$/client/gui/widgets.ts"; +import { TextInput } from "@/client/gui/widgets.ts"; // the text with the selection in [brackets], or a | at the caret when nothing is selected function show(input: TextInput) { diff --git a/tests/texture_animation_test.ts b/tests/texture_animation_test.ts index 22feead..0f373f9 100644 --- a/tests/texture_animation_test.ts +++ b/tests/texture_animation_test.ts @@ -4,12 +4,12 @@ // animated textures: textures/.json, carrying it through .bmod files, and playing it a tick at a time import { assertEquals, assertThrows } from "@std/assert"; import { zipSync } from "fflate"; -import { read_bmod, texture_size_problem } from "$/common/bmod.ts"; -import { texture_animation, validate_texture_json } from "$/common/texture_animation.ts"; -import { AnimatedTexture } from "$/client/texture_animations.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { pack_mod } from "$/tools/pack_mod.ts"; -import { create_mod } from "$/tools/new_mod.ts"; +import { read_bmod, texture_size_problem } from "@/common/bmod.ts"; +import { texture_animation, validate_texture_json } from "@/common/texture_animation.ts"; +import { AnimatedTexture } from "@/client/texture_animations.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { pack_mod } from "@/tools/pack_mod.ts"; +import { create_mod } from "@/tools/new_mod.ts"; import { copy_dir } from "./helpers.ts"; // a png's header and nothing else, enough for everything that only reads its size diff --git a/tests/time_test.ts b/tests/time_test.ts index 9bae539..82cd3cd 100644 --- a/tests/time_test.ts +++ b/tests/time_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { clock, CYCLE_TICKS, DAY_TICKS, daylight, format_clock, is_day, NIGHT_TICKS } from "$/common/time.ts"; +import { clock, CYCLE_TICKS, DAY_TICKS, daylight, format_clock, is_day, NIGHT_TICKS } from "@/common/time.ts"; import { test_game } from "./helpers.ts"; Deno.test("a day is 30 minutes and a night 10, tick 0 is 06:00 of day 1", () => { diff --git a/tests/tint_test.ts b/tests/tint_test.ts index 960d8a5..5168a87 100644 --- a/tests/tint_test.ts +++ b/tests/tint_test.ts @@ -3,11 +3,11 @@ // blocks with a "tint" are drawn in their biome's grass or foliage color, blended across biome edges, or a fixed one. water is its biome's water color import { assert, assertEquals } from "@std/assert"; -import { BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; -import { get_biome } from "$/common/worldgen/biomes.ts"; -import { type LayerMesh, TERRAIN_VERTEX_BYTES } from "$/client/workers/chunk_messages.ts"; +import { BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; +import { get_biome } from "@/common/worldgen/biomes.ts"; +import { type LayerMesh, TERRAIN_VERTEX_BYTES } from "@/client/workers/chunk_messages.ts"; import { test_game } from "./helpers.ts"; type Colors = { grass: number; foliage: number; water?: number }; diff --git a/tests/trapdoor_test.ts b/tests/trapdoor_test.ts index b5adac2..030128a 100644 --- a/tests/trapdoor_test.ts +++ b/tests/trapdoor_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { Container, ItemStack } from "$/common/inventory.ts"; -import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { bake_block, type ModelJson } from "$/common/block_models.ts"; -import { collision_shape_at, shape_at } from "$/common/block_shapes.ts"; -import { get_state_value } from "$/common/utils.ts"; -import { update_crafting_result } from "$/server/game/crafting.ts"; +import { Container, ItemStack } from "@/common/inventory.ts"; +import { CRAFTING_RESULT_SLOT } from "@/common/protocol.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { bake_block, type ModelJson } from "@/common/block_models.ts"; +import { collision_shape_at, shape_at } from "@/common/block_shapes.ts"; +import { get_state_value } from "@/common/utils.ts"; +import { update_crafting_result } from "@/server/game/crafting.ts"; import { test_game } from "./helpers.ts"; // alice on a stone floor at y 100, south of 0 100 0 and looking north, with oak trapdoors in hand diff --git a/tests/verdigris.ts b/tests/verdigris.ts index 5047a6f..72633d6 100644 --- a/tests/verdigris.ts +++ b/tests/verdigris.ts @@ -3,15 +3,15 @@ // what the verdigris tests build with: a player on a stone floor placing things, and the world read the way the // verdigris scripts read it -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import type { Face } from "$/common/mod_api/shared.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { block_states } from "$/common/utils.ts"; -import type { WorldSave } from "$/server/game/saves.ts"; -import { joined_cell } from "$/mods/bworld/scripts/verdigris/joins.ts"; -import type { BlockReader } from "$/mods/bworld/scripts/verdigris/signals.ts"; -import { FACES } from "$/mods/bworld/scripts/verdigris/sides.ts"; -import { wire_at } from "$/mods/bworld/scripts/verdigris/wires.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import type { Face } from "@/common/mod_api/shared.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { block_states } from "@/common/utils.ts"; +import type { WorldSave } from "@/server/game/saves.ts"; +import { joined_cell } from "@/mods/bworld/scripts/verdigris/joins.ts"; +import type { BlockReader } from "@/mods/bworld/scripts/verdigris/signals.ts"; +import { FACES } from "@/mods/bworld/scripts/verdigris/sides.ts"; +import { wire_at } from "@/mods/bworld/scripts/verdigris/wires.ts"; import { type Area, test_game } from "./helpers.ts"; export type Pos = [number, number, number]; diff --git a/tests/verdigris_devices_test.ts b/tests/verdigris_devices_test.ts index 61d13b7..eb1a4de 100644 --- a/tests/verdigris_devices_test.ts +++ b/tests/verdigris_devices_test.ts @@ -3,14 +3,14 @@ // the blocks that make and use verdigris signals import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; -import { bake_block, type BakedQuad, type ModelJson } from "$/common/block_models.ts"; -import { block_shape } from "$/common/block_shapes.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import type { Face } from "$/common/mod_api/shared.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { default_block_value, set_state_value } from "$/common/utils.ts"; -import { ways_out } from "$/mods/bworld/scripts/verdigris/joins.ts"; -import { FACE_OFFSETS, FACES, OPPOSITE, step } from "$/mods/bworld/scripts/verdigris/sides.ts"; +import { bake_block, type BakedQuad, type ModelJson } from "@/common/block_models.ts"; +import { block_shape } from "@/common/block_shapes.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import type { Face } from "@/common/mod_api/shared.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { default_block_value, set_state_value } from "@/common/utils.ts"; +import { ways_out } from "@/mods/bworld/scripts/verdigris/joins.ts"; +import { FACE_OFFSETS, FACES, OPPOSITE, step } from "@/mods/bworld/scripts/verdigris/sides.ts"; import { client_of, server_blocks, test_game } from "./helpers.ts"; import { AREA, type Builder, builder, type Pos } from "./verdigris.ts"; diff --git a/tests/verdigris_wire_test.ts b/tests/verdigris_wire_test.ts index 06f708b..29a9e9c 100644 --- a/tests/verdigris_wire_test.ts +++ b/tests/verdigris_wire_test.ts @@ -4,16 +4,16 @@ // verdigris wire: how it's drawn on the faces of its cell, how it joins, and its nets' power import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; import { Alea } from "@paulaboks/rng"; -import { bake_block, type BakedQuad, FACE_INDEX, type ModelJson } from "$/common/block_models.ts"; -import { block_shape, is_solid } from "$/common/block_shapes.ts"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import type { Face } from "$/common/mod_api/shared.ts"; -import { AIR_ID } from "$/common/protocol.ts"; -import { default_block_value, set_state_value } from "$/common/utils.ts"; -import type { SavedChunk, WorldSave } from "$/server/game/saves.ts"; -import { can_cover, ways_out } from "$/mods/bworld/scripts/verdigris/joins.ts"; -import { DIRECTIONS, FACE_OFFSETS, FACES, OPPOSITE, step } from "$/mods/bworld/scripts/verdigris/sides.ts"; -import { NetIndex } from "$/mods/bworld/scripts/verdigris/wires.ts"; +import { bake_block, type BakedQuad, FACE_INDEX, type ModelJson } from "@/common/block_models.ts"; +import { block_shape, is_solid } from "@/common/block_shapes.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import type { Face } from "@/common/mod_api/shared.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { default_block_value, set_state_value } from "@/common/utils.ts"; +import type { SavedChunk, WorldSave } from "@/server/game/saves.ts"; +import { can_cover, ways_out } from "@/mods/bworld/scripts/verdigris/joins.ts"; +import { DIRECTIONS, FACE_OFFSETS, FACES, OPPOSITE, step } from "@/mods/bworld/scripts/verdigris/sides.ts"; +import { NetIndex } from "@/mods/bworld/scripts/verdigris/wires.ts"; import { client_of, server_blocks, test_game } from "./helpers.ts"; import { AREA, type Builder, builder, type Pos } from "./verdigris.ts"; diff --git a/tests/visuals_test.ts b/tests/visuals_test.ts index c384829..1ac8d6a 100644 --- a/tests/visuals_test.ts +++ b/tests/visuals_test.ts @@ -5,19 +5,19 @@ // draws their instances, placed and turned by the time import { assert, assertEquals, assertRejects, assertThrows } from "@std/assert"; import { mat4 } from "gl-matrix"; -import { BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "$/common/constants.ts"; -import { block_value } from "$/common/utils.ts"; -import type { ModListing } from "$/common/mod_loader.ts"; -import { read_bmod } from "$/common/bmod.ts"; -import type { FluidInstance, Instances, RotatingInstance, Visual } from "$/common/mod_api/client.ts"; -import { block_visuals, instance_quads, InstanceGroup, pack_model, Visuals } from "$/client/rendering/visuals.ts"; -import { INSTANCE_FLOATS, INSTANCED_BUFFERS, terrain_shader_src, type Texture } from "$/client/renderer/mod.ts"; -import type { BakedQuad } from "$/common/block_models.ts"; -import { AssetManager } from "$/client/assets.ts"; -import { load_client_mods } from "$/client/mods.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; -import { pack_mod } from "$/tools/pack_mod.ts"; +import { BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE } from "@/common/constants.ts"; +import { block_value } from "@/common/utils.ts"; +import type { ModListing } from "@/common/mod_loader.ts"; +import { read_bmod } from "@/common/bmod.ts"; +import type { FluidInstance, Instances, RotatingInstance, Visual } from "@/common/mod_api/client.ts"; +import { block_visuals, instance_quads, InstanceGroup, pack_model, Visuals } from "@/client/rendering/visuals.ts"; +import { INSTANCE_FLOATS, INSTANCED_BUFFERS, terrain_shader_src, type Texture } from "@/client/renderer/mod.ts"; +import type { BakedQuad } from "@/common/block_models.ts"; +import { AssetManager } from "@/client/assets.ts"; +import { load_client_mods } from "@/client/mods.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; +import { pack_mod } from "@/tools/pack_mod.ts"; import { copy_dir, test_game } from "./helpers.ts"; const HALF = { @@ -499,7 +499,7 @@ Deno.test("client scripts register visuals during setup, for blocks that exist", await load_client_mods([listing], [bmod]); }; await load(` - import type { ClientContext } from "bworld/client"; + import type { ClientContext } from "cubi/client"; export function setup(ctx: ClientContext) { ctx.render.register_visual("testmod:shaft", (_block, instances) => { instances.rotating(); @@ -513,7 +513,7 @@ Deno.test("client scripts register visuals during setup, for blocks that exist", await assertRejects( () => load(` - import type { ClientContext } from "bworld/client"; + import type { ClientContext } from "cubi/client"; export function setup(ctx: ClientContext) { ctx.render.register_visual("testmod:gear", () => ({})); } diff --git a/tests/vitals_test.ts b/tests/vitals_test.ts index 9d3fac3..ef7e715 100644 --- a/tests/vitals_test.ts +++ b/tests/vitals_test.ts @@ -3,10 +3,10 @@ // health, hunger and saturation, with minecraft's rules import { assert, assertAlmostEquals, assertEquals } from "@std/assert"; -import { MAX_HEALTH, Vitals } from "$/server/game/vitals.ts"; +import { MAX_HEALTH, Vitals } from "@/server/game/vitals.ts"; import { test_game } from "./helpers.ts"; -import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts"; -import { ItemStack } from "$/common/inventory.ts"; +import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts"; +import { ItemStack } from "@/common/inventory.ts"; // deno-lint-ignore no-explicit-any type Msg = any; diff --git a/tests/waterlog_test.ts b/tests/waterlog_test.ts index 8f76a83..2aa5b0b 100644 --- a/tests/waterlog_test.ts +++ b/tests/waterlog_test.ts @@ -4,8 +4,8 @@ // waterlogging, like minecraft's: a fence holds a water source, which flows out of it, can be bucketed in and out, and // is left behind when the fence is broken import { assert, assertEquals } from "@std/assert"; -import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; -import { get_state_value, set_state_value } from "$/common/utils.ts"; +import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; +import { get_state_value, set_state_value } from "@/common/utils.ts"; import { test_game } from "./helpers.ts"; // a player at 0.5 100 0.5 on stone, holding what they're given diff --git a/tests/wood_test.ts b/tests/wood_test.ts index 8f2c481..ddcb387 100644 --- a/tests/wood_test.ts +++ b/tests/wood_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals, assertRejects } from "@std/assert"; -import { CHUNK_AREA, CHUNK_SIZE } from "$/common/constants.ts"; -import { Container, ItemStack } from "$/common/inventory.ts"; -import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; -import { get_biome } from "$/common/worldgen/biomes.ts"; -import { update_crafting_result } from "$/server/game/crafting.ts"; -import { recipe_lookup } from "$/common/mod_loader.ts"; +import { CHUNK_AREA, CHUNK_SIZE } from "@/common/constants.ts"; +import { Container, ItemStack } from "@/common/inventory.ts"; +import { CRAFTING_RESULT_SLOT } from "@/common/protocol.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; +import { get_biome } from "@/common/worldgen/biomes.ts"; +import { update_crafting_result } from "@/server/game/crafting.ts"; +import { recipe_lookup } from "@/common/mod_loader.ts"; import { copy_dir, test_game } from "./helpers.ts"; Deno.test("recipes that take planks take any kind, even mixed, but nothing else", async () => { diff --git a/tests/world_save_test.ts b/tests/world_save_test.ts index 3e853aa..f36ce29 100644 --- a/tests/world_save_test.ts +++ b/tests/world_save_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { AIR_ID } from "$/common/protocol.ts"; -import { CHUNK_AREA } from "$/common/constants.ts"; -import { CHUNK_VOLUME, decode_chunk, encode_chunk, SavedChunk } from "$/server/game/saves.ts"; -import { list_chunks, read_chunk, region_file, write_chunks } from "$/server/regions.ts"; +import { AIR_ID } from "@/common/protocol.ts"; +import { CHUNK_AREA } from "@/common/constants.ts"; +import { CHUNK_VOLUME, decode_chunk, encode_chunk, SavedChunk } from "@/server/game/saves.ts"; +import { list_chunks, read_chunk, region_file, write_chunks } from "@/server/regions.ts"; import { sent_block, test_game } from "./helpers.ts"; function chunk_data(seed: number, palette_size = 3) { diff --git a/tests/worldgen_bench.ts b/tests/worldgen_bench.ts index f78d6c9..ff129d7 100644 --- a/tests/worldgen_bench.ts +++ b/tests/worldgen_bench.ts @@ -3,7 +3,7 @@ // how long generating chunks takes, on one thread. moving the terrain from code to data was held to 15% slower here, // and cost about 9% (144.5 to 157.7 ms on the machine it was measured on). deno task bench -import { generate_raw_chunk } from "$/common/generation.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; import { test_game } from "./helpers.ts"; const SEED = "bench-seed"; diff --git a/tests/worldgen_bundle_test.ts b/tests/worldgen_bundle_test.ts index 99c9451..69d87c7 100644 --- a/tests/worldgen_bundle_test.ts +++ b/tests/worldgen_bundle_test.ts @@ -4,8 +4,8 @@ // the bundle is everything generation reads, so a worker sent it generates what the game does. see // common/worldgen_bundle.ts import { assert, assertEquals } from "@std/assert"; -import { EverythingRegistry } from "$/common/everything_registry.ts"; -import { load_bundle } from "$/common/worldgen_bundle.ts"; +import { EverythingRegistry } from "@/common/everything_registry.ts"; +import { load_bundle } from "@/common/worldgen_bundle.ts"; import { test_game } from "./helpers.ts"; import { golden_chunks, namer, raw_hash, recorded, SEEDS } from "./golden.ts"; diff --git a/tests/worldgen_features_test.ts b/tests/worldgen_features_test.ts index 467daff..a93b301 100644 --- a/tests/worldgen_features_test.ts +++ b/tests/worldgen_features_test.ts @@ -3,8 +3,8 @@ // the base game's worldgen features, see mods/bworld/scripts/worldgen.ts import { assert, assertEquals } from "@std/assert"; -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; import { test_game } from "./helpers.ts"; // a desert on this seed, found with estimate_biome diff --git a/tests/worldgen_golden_test.ts b/tests/worldgen_golden_test.ts index 3119beb..d855628 100644 --- a/tests/worldgen_golden_test.ts +++ b/tests/worldgen_golden_test.ts @@ -7,7 +7,7 @@ // after a change that's meant to change generation, record it again: // deno test -A tests/worldgen_golden_test.ts -- --update import { assertEquals } from "@std/assert"; -import { generate_raw_chunk } from "$/common/generation.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; import { test_game } from "./helpers.ts"; import { final_hash, FIXTURE, golden_chunks, type Hashes, namer, raw_hash, recorded, SEEDS } from "./golden.ts"; diff --git a/tests/worldgen_pool_test.ts b/tests/worldgen_pool_test.ts index 1a7e5ca..3d3780d 100644 --- a/tests/worldgen_pool_test.ts +++ b/tests/worldgen_pool_test.ts @@ -4,10 +4,10 @@ // chunks generated in worldgen workers are the ones the game would generate, in any order and with any number of // workers. see server/game/worldgen_pool.ts import { assert, assertEquals } from "@std/assert"; -import { chunk_key } from "$/common/utils.ts"; -import type { RawChunk } from "$/common/generation.ts"; -import { type WorkerPort, WorldgenPool } from "$/server/game/worldgen_pool.ts"; -import { start_worldgen_workers } from "$/server/worldgen_workers.ts"; +import { chunk_key } from "@/common/utils.ts"; +import type { RawChunk } from "@/common/generation.ts"; +import { type WorkerPort, WorldgenPool } from "@/server/game/worldgen_pool.ts"; +import { start_worldgen_workers } from "@/server/worldgen_workers.ts"; import { test_game } from "./helpers.ts"; import { golden_chunks, namer, raw_hash, recorded } from "./golden.ts"; diff --git a/tests/worldgen_test.ts b/tests/worldgen_test.ts index da9d877..8103af2 100644 --- a/tests/worldgen_test.ts +++ b/tests/worldgen_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import { assert, assertEquals } from "@std/assert"; -import { CHUNK_AREA, CHUNK_HEIGHT, SEA_LEVEL } from "$/common/constants.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, SEA_LEVEL } from "@/common/constants.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; import { test_game } from "./helpers.ts"; Deno.test("the overworld generates the same way every time, with water only below sea level", async () => { diff --git a/tests/worm_bin_test.ts b/tests/worm_bin_test.ts index 64f7be6..bfe60a3 100644 --- a/tests/worm_bin_test.ts +++ b/tests/worm_bin_test.ts @@ -3,8 +3,8 @@ // the worm bin: one worm_binable item in its input makes 5 more of it every morning, into its output import { assert, assertEquals } from "@std/assert"; -import { CYCLE_TICKS } from "$/common/time.ts"; -import { Container, ItemStack } from "$/common/inventory.ts"; +import { CYCLE_TICKS } from "@/common/time.ts"; +import { Container, ItemStack } from "@/common/inventory.ts"; import { menu_items, opened_menu, test_game } from "./helpers.ts"; // the container's slots, see register_worm_bin diff --git a/tests/worn_render_test.ts b/tests/worn_render_test.ts index 6cd8066..63874c1 100644 --- a/tests/worn_render_test.ts +++ b/tests/worn_render_test.ts @@ -3,8 +3,8 @@ // what players wear is drawn on their parts, moving with them, see client/rendering/worn_renderer.ts import { assertAlmostEquals, assertEquals, assertNotEquals } from "@std/assert"; -import { entity_model_from_geo } from "$/common/mod_data.ts"; -import { apply, bone_matrices, type Vec3 } from "$/client/rendering/model_math.ts"; +import { entity_model_from_geo } from "@/common/mod_data.ts"; +import { apply, bone_matrices, type Vec3 } from "@/client/rendering/model_math.ts"; import { on_part, part_point, @@ -13,7 +13,7 @@ import { SLIM_PARTS, worn_bone_pose, worn_look, -} from "$/client/rendering/player_model.ts"; +} from "@/client/rendering/player_model.ts"; // a glove made over blockbench's player template: its right arm's box, and a claw on a bone under it const glove = entity_model_from_geo({ diff --git a/tools/check_mods.ts b/tools/check_mods.ts index f47ee78..81b86e9 100644 --- a/tools/check_mods.ts +++ b/tools/check_mods.ts @@ -22,20 +22,20 @@ import { validate_recipe, validate_spawn, validate_tag, -} from "$/common/mod_data.ts"; -import { json_object } from "$/common/schema.ts"; -import { check_references, load_order, type LoadedMod, type ModReport } from "$/common/mod_check.ts"; -import { png_size, texture_size_problem } from "$/common/bmod.ts"; -import { type TextureJson, validate_texture_json } from "$/common/texture_animation.ts"; -import { type LootTableJson, validate_loot_table } from "$/common/loot.ts"; -import { validate_biome } from "$/common/worldgen/biomes.ts"; +} from "@/common/mod_data.ts"; +import { json_object } from "@/common/schema.ts"; +import { check_references, load_order, type LoadedMod, type ModReport } from "@/common/mod_check.ts"; +import { png_size, texture_size_problem } from "@/common/bmod.ts"; +import { type TextureJson, validate_texture_json } from "@/common/texture_animation.ts"; +import { type LootTableJson, validate_loot_table } from "@/common/loot.ts"; +import { validate_biome } from "@/common/worldgen/biomes.ts"; import { validate_biome_source, validate_density_function, validate_noise, validate_noise_settings, -} from "$/common/worldgen/data.ts"; -import { validate_feature } from "$/common/worldgen/features.ts"; +} from "@/common/worldgen/data.ts"; +import { validate_feature } from "@/common/worldgen/features.ts"; import { dirname } from "@std/path"; export { load_order, type LoadedMod, type ModReport }; @@ -125,14 +125,14 @@ function load_mod(mods_dir: string, id: string): LoadedMod { error(`manifest.json: scripts.${side} ${path} doesn't exist`); } } - // bworld/engine needs engine_access, it's checked again on the bundled code when a .bmod loads + // cubi/engine needs engine_access, it's checked again on the bundled code when a .bmod loads if (mod.manifest?.engine_access !== true) { const folders = new Set(Object.values(scripts).filter((p) => typeof p === "string").map((p) => dirname(p))); for (const folder of folders) { for (const file of [...walk(`${dir}/${folder}`, ".ts"), ...walk(`${dir}/${folder}`, ".js")]) { - if (/["']bworld\/engine["']/.test(Deno.readTextFileSync(`${dir}/${folder}/${file}`))) { + if (/["']cubi\/engine["']/.test(Deno.readTextFileSync(`${dir}/${folder}/${file}`))) { error( - `${folder}/${file} imports bworld/engine, which needs "engine_access": true in manifest.json`, + `${folder}/${file} imports cubi/engine, which needs "engine_access": true in manifest.json`, ); } } diff --git a/tools/importer/blocks.ts b/tools/importer/blocks.ts index a2a2a04..a05a977 100644 --- a/tools/importer/blocks.ts +++ b/tools/importer/blocks.ts @@ -6,7 +6,7 @@ // mods set mining, sounds and what blocks do in code), so every block gets the same placeholders: a second to break with // anything, dropping itself, and what they really have is written by hand after import { dirname, join } from "@std/path"; -import { FORMAT_VERSION } from "$/common/mod_data.ts"; +import { FORMAT_VERSION } from "@/common/mod_data.ts"; import { is_empty, made_by, model_source, type ModelSource } from "./models.ts"; import { DEFAULT_REMAPS, diff --git a/tools/importer/items.ts b/tools/importer/items.ts index d07a20a..f04c329 100644 --- a/tools/importer/items.ts +++ b/tools/importer/items.ts @@ -6,7 +6,7 @@ // layer0 texture, which is what a bworld item is, and its layer1 and on are its layers. one java draws in 3D (a wrench) // is drawn with its model, which the model kind writes, and gets its model's particle texture as its texture import { join } from "@std/path"; -import { FORMAT_VERSION } from "$/common/mod_data.ts"; +import { FORMAT_VERSION } from "@/common/mod_data.ts"; import { made_by, model_source } from "./models.ts"; import { merged_textures, model_missing, models_near } from "./blocks.ts"; import { diff --git a/tools/importer/models.ts b/tools/importer/models.ts index 32e7303..a4b98a7 100644 --- a/tools/importer/models.ts +++ b/tools/importer/models.ts @@ -5,8 +5,8 @@ // bottom instead of up and down, ids lose their folders, a parent keeps being a parent (bworld merges them when it // loads, see resolve_models), and what bworld has no use for (blockbench's names, display transforms for places bworld // doesn't show items, like third person) is left out -import type { ModelDisplay, ModelElementJson, ModelFaceJson, ModelFileJson } from "$/common/block_models.ts"; -import { DISPLAY_CONTEXTS, FORMAT_VERSION, type ModelFace } from "$/common/mod_data.ts"; +import type { ModelDisplay, ModelElementJson, ModelFaceJson, ModelFileJson } from "@/common/block_models.ts"; +import { DISPLAY_CONTEXTS, FORMAT_VERSION, type ModelFace } from "@/common/mod_data.ts"; import { join } from "@std/path"; import { DEFAULT_REMAPS, diff --git a/tools/importer/recipes.ts b/tools/importer/recipes.ts index 1392967..a57b3b5 100644 --- a/tools/importer/recipes.ts +++ b/tools/importer/recipes.ts @@ -5,7 +5,7 @@ // each type bworld or a ported mod has an equivalent for is converted, the rest are reported. a recipe naming an item or tag that // doesn't exist here is left out, since bworld's recipes have to be complete import { join } from "@std/path"; -import { FORMAT_VERSION } from "$/common/mod_data.ts"; +import { FORMAT_VERSION } from "@/common/mod_data.ts"; import { known_tag, tag_id } from "./tags.ts"; import { DEFAULT_REMAPS, diff --git a/tools/importer/resources.ts b/tools/importer/resources.ts index 9281164..ada1344 100644 --- a/tools/importer/resources.ts +++ b/tools/importer/resources.ts @@ -4,10 +4,10 @@ // where things are in a java mod's resources, and what they're called in bworld. a resource location like // "create:block/cogwheel" (or "block/stone", which is minecraft's) becomes the id "create:block_cogwheel": bworld ids // have no folders, so the path's folders are joined with _, the same way check_mods names textures in subfolders -import type { TagRegistry } from "$/common/mod_data.ts"; -import { ID_PATTERN } from "$/common/schema.ts"; -import { registered_ids } from "$/common/mod_check.ts"; -import { load_and_check } from "$/tools/check_mods.ts"; +import type { TagRegistry } from "@/common/mod_data.ts"; +import { ID_PATTERN } from "@/common/schema.ts"; +import { registered_ids } from "@/common/mod_check.ts"; +import { load_and_check } from "@/tools/check_mods.ts"; import { dirname, relative, resolve, SEPARATOR } from "@std/path"; export interface Location { diff --git a/tools/importer/tags.ts b/tools/importer/tags.ts index 6f04ccf..6b5e6f8 100644 --- a/tools/importer/tags.ts +++ b/tools/importer/tags.ts @@ -5,8 +5,8 @@ // format is the same: values, replace and remove, with { id, required: false } for entries that can be missing. tag ids // keep their folders, since bworld's can have them too import { join } from "@std/path"; -import { FORMAT_VERSION, type TagRegistry } from "$/common/mod_data.ts"; -import { TAG_ID_PATTERN } from "$/common/schema.ts"; +import { FORMAT_VERSION, type TagRegistry } from "@/common/mod_data.ts"; +import { TAG_ID_PATTERN } from "@/common/schema.ts"; import { DEFAULT_REMAPS, empty_report, diff --git a/tools/importer/textures.ts b/tools/importer/textures.ts index c88f198..0d7b3ac 100644 --- a/tools/importer/textures.ts +++ b/tools/importer/textures.ts @@ -6,8 +6,8 @@ // converted from the same mod find their textures. a .png.mcmeta becomes the .json next to the png: bworld reads the // same animation format import { join } from "@std/path"; -import { png_size, texture_size_problem } from "$/common/bmod.ts"; -import { type TextureJson, validate_texture_json } from "$/common/texture_animation.ts"; +import { png_size, texture_size_problem } from "@/common/bmod.ts"; +import { type TextureJson, validate_texture_json } from "@/common/texture_animation.ts"; import { DEFAULT_REMAPS, empty_report, diff --git a/tools/new_mod.ts b/tools/new_mod.ts index 6c86a71..66e9174 100644 --- a/tools/new_mod.ts +++ b/tools/new_mod.ts @@ -3,7 +3,7 @@ // deno task new-mod ["Display Name"] // copies templates/mod into mods/, with the template's placeholder id and name replaced -import { NAMESPACE_PATTERN, RESERVED_NAMESPACES } from "$/common/mod_data.ts"; +import { NAMESPACE_PATTERN, RESERVED_NAMESPACES } from "@/common/mod_data.ts"; const TEMPLATE = "templates/mod"; const PLACEHOLDER_ID = "example_mod"; diff --git a/tools/noise_quantiles.ts b/tools/noise_quantiles.ts index c67722c..ea0a210 100644 --- a/tools/noise_quantiles.ts +++ b/tools/noise_quantiles.ts @@ -3,7 +3,7 @@ // measures the percentiles of octave noise, for the "quantiles" of a noise file (worldgen/noise in a mod). // they only depend on the amplitudes. deno run tools/noise_quantiles.ts '[1,1,2,2,1,1]' '[1,2,1]' -import { OctaveNoise2D } from "$/common/worldgen/noise.ts"; +import { OctaveNoise2D } from "@/common/worldgen/noise.ts"; const SAMPLES_PER_SEED = 20000; const SEEDS = 20; diff --git a/tools/pack_mod.ts b/tools/pack_mod.ts index 97dff23..34a077a 100644 --- a/tools/pack_mod.ts +++ b/tools/pack_mod.ts @@ -5,10 +5,10 @@ // builds a mod folder into a .bmod: its data merged into data.json, each script bundled into one module, and its // textures and credits. deno task build does this for every mod in mods/, see docs/modding/gettingstarted/modfiles.md import { basename, dirname, resolve } from "@std/path"; -import { type Bmod, BMOD_EXTENSION, SCRIPT_SIDES, type ScriptSide, write_bmod } from "$/common/bmod.ts"; -import type { ManifestJson } from "$/common/mod_data.ts"; +import { type Bmod, BMOD_EXTENSION, SCRIPT_SIDES, type ScriptSide, write_bmod } from "@/common/bmod.ts"; +import type { ManifestJson } from "@/common/mod_data.ts"; import { load_and_check, type LoadedMod, mod_deno_config } from "./check_mods.ts"; -import { mod_data } from "$/common/mod_check.ts"; +import { mod_data } from "@/common/mod_check.ts"; // what each script is bundled for: the server runs in deno, clients in browsers, worldgen and shared in both const PLATFORMS: Record = { diff --git a/tools/verdigris_wire_model.ts b/tools/verdigris_wire_model.ts index 90f4cc2..820bf09 100644 --- a/tools/verdigris_wire_model.ts +++ b/tools/verdigris_wire_model.ts @@ -11,12 +11,12 @@ // // the parts lock their textures to the world (uvlock), so every piece shows the part of the texture under it, the // texture's line running north to south or its line running east to west, and it lines up from one wire to the next -import { model_shape } from "$/common/block_shapes.ts"; -import type { ModelElementJson } from "$/common/block_models.ts"; -import type { ModelFace } from "$/common/mod_data.ts"; -import type { Face } from "$/common/mod_api/shared.ts"; -import { can_cover, ways_out } from "$/mods/bworld/scripts/verdigris/joins.ts"; -import { DIRECTIONS, FACE_OFFSETS, FACES } from "$/mods/bworld/scripts/verdigris/sides.ts"; +import { model_shape } from "@/common/block_shapes.ts"; +import type { ModelElementJson } from "@/common/block_models.ts"; +import type { ModelFace } from "@/common/mod_data.ts"; +import type { Face } from "@/common/mod_api/shared.ts"; +import { can_cover, ways_out } from "@/mods/bworld/scripts/verdigris/joins.ts"; +import { DIRECTIONS, FACE_OFFSETS, FACES } from "@/mods/bworld/scripts/verdigris/sides.ts"; const MODELS = "mods/bworld/models"; const BLOCK = "mods/bworld/blocks/verdigris_wire.json"; diff --git a/tools/worldgen_preview.ts b/tools/worldgen_preview.ts index 8ce8edc..b1b0997 100644 --- a/tools/worldgen_preview.ts +++ b/tools/worldgen_preview.ts @@ -6,11 +6,11 @@ // map.png: 4096 blocks across from the terrain's heights and biomes (fast, no caves or 3d noise) // blocks.png: 768 blocks across from real generated chunks, top block with hill shading // section.png: a slice down through the world along x, showing caves, overhangs and underground rivers -import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, SEA_LEVEL } from "$/common/constants.ts"; -import { generate_raw_chunk } from "$/common/generation.ts"; -import { load_worldgen } from "$/common/worldgen_loader.ts"; -import { register_mod_data } from "$/common/mod_loader.ts"; -import { BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts"; +import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, SEA_LEVEL } from "@/common/constants.ts"; +import { generate_raw_chunk } from "@/common/generation.ts"; +import { load_worldgen } from "@/common/worldgen_loader.ts"; +import { register_mod_data } from "@/common/mod_loader.ts"; +import { BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts"; import { load_and_check } from "./check_mods.ts"; const seed = Deno.args[0] ?? "preview";