Change imports

This commit is contained in:
2026-11-04 21:51:26 -03:00
parent 98fa45ebd1
commit ba4b2a8798
270 changed files with 994 additions and 994 deletions
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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";
+2 -2
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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"];
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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) {
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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,