Rename engine to cubi

This commit is contained in:
2026-11-03 17:17:37 -03:00
parent 68b78f053a
commit 98fa45ebd1
109 changed files with 643 additions and 788 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
},
"components": {
"bworld:curio_modifiers": [
{ "attribute": "bworld:attack_speed", "amount": 0.3, "operation": "add_multiplied_base" }
{ "attribute": "cubi:attack_speed", "amount": 0.3, "operation": "add_multiplied_base" }
]
}
}
+1 -1
View File
@@ -12,7 +12,7 @@
},
"components": {
"bworld:curio_modifiers": [
{ "attribute": "bworld:attack_damage", "amount": 4, "operation": "add_value" }
{ "attribute": "cubi:attack_damage", "amount": 4, "operation": "add_value" }
]
}
}
+1 -1
View File
@@ -48,7 +48,7 @@ The Power Glove from Artifacts:
```json
"components": {
"bworld:curio_modifiers": [{ "attribute": "bworld:attack_damage", "amount": 4, "operation": "add_value" }]
"bworld:curio_modifiers": [{ "attribute": "cubi:attack_damage", "amount": 4, "operation": "add_value" }]
}
```
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"crop": "bworld:beetroot_stage_0"
},
"model": "engine:crop",
"model": "cubi:crop",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"cross": "bworld:cabbages_stage0"
},
"model": "engine:cross",
"model": "cubi:cross",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"crop": "bworld:carrot_stage_0"
},
"model": "engine:crop",
"model": "cubi:crop",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"cross": "bworld:cotton_stage_0"
},
"model": "engine:cross",
"model": "cubi:cross",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -6,7 +6,7 @@
"textures": {
"cross": "bworld:dead_bush"
},
"model": "engine:cross",
"model": "cubi:cross",
"render_layer": "cutout",
"collision": false,
"shape": [[2, 0, 2, 14, 13, 14]],
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"crop": "bworld:melon_stage_0"
},
"model": "engine:crop",
"model": "cubi:crop",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"crop": "bworld:onions_stage0"
},
"model": "engine:crop",
"model": "cubi:crop",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"crop": "bworld:potatoes_stage_0"
},
"model": "engine:crop",
"model": "cubi:crop",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"crop": "bworld:pumpkin_stage_0"
},
"model": "engine:crop",
"model": "cubi:crop",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"cross": "bworld:rice_stage0"
},
"model": "engine:cross",
"model": "cubi:cross",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"cross": "bworld:rice_panicles_stage0"
},
"model": "engine:cross",
"model": "cubi:cross",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"cross": "bworld:strawberry_stage_0"
},
"model": "engine:cross",
"model": "cubi:cross",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -6,7 +6,7 @@
"textures": {
"cross": "bworld:sugar_cane_block"
},
"model": "engine:cross",
"model": "cubi:cross",
"render_layer": "cutout",
"shape": [[1, 0, 1, 15, 16, 15]],
"mining": {
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"cross": "bworld:budding_tomatoes_stage0"
},
"model": "engine:cross",
"model": "cubi:cross",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -13,7 +13,7 @@
"loot_table": "bworld:blocks/verdigris_wire",
"item": false,
"place_in": [
"bworld:air",
"cubi:air",
"bworld:verdigris_wire"
],
"states": [
+1 -1
View File
@@ -5,7 +5,7 @@
"textures": {
"crop": "bworld:wheat_stage_0"
},
"model": "engine:crop",
"model": "cubi:crop",
"variants": {
"age=0": {
"textures": {
+1 -1
View File
@@ -6,7 +6,7 @@
"icon": "bworld:slow",
"modifiers": [
{
"attribute": "bworld:movement_speed",
"attribute": "cubi:movement_speed",
"amount": -0.15,
"operation": "add_multiplied_total"
}
+1 -1
View File
@@ -6,7 +6,7 @@
"icon": "bworld:speed",
"modifiers": [
{
"attribute": "bworld:movement_speed",
"attribute": "cubi:movement_speed",
"amount": 0.2,
"operation": "add_multiplied_total"
}
+1 -1
View File
@@ -7,7 +7,7 @@
"worn": { "model": "bworld:giant_chestplate", "texture": "bworld:giant_chestplate_worn" },
"components": {
"bworld:curio_modifiers": [
{ "attribute": "bworld:max_health", "amount": 20, "operation": "add_value" }
{ "attribute": "cubi:max_health", "amount": 20, "operation": "add_value" }
],
"bworld:curio_unhurt_effect": { "effect": "bworld:regeneration", "amplifier": 2, "after": 200 }
}
+8 -8
View File
@@ -678,7 +678,7 @@ function register_farming(ctx: ServerContext) {
const die = (block: BlockRef, params: CropParams) => {
const { x, y, z } = block;
if (params.upper && ctx.world.get_block(x, y + 1, z) === params.upper.block) {
ctx.world.set_block(x, y + 1, z, "bworld:air");
ctx.world.set_block(x, y + 1, z, "cubi:air");
}
ctx.world.set_block(x, y, z, DEAD_BUSH);
};
@@ -711,11 +711,11 @@ function register_farming(ctx: ServerContext) {
const above = ctx.world.get_block(block.x, block.y + 1, block.z);
if (!upper || stage < params.stages) {
ctx.world.set_state(block.x, block.y, block.z, "age", stage);
if (upper && above === upper.block) ctx.world.set_block(block.x, block.y + 1, block.z, "bworld:air");
if (upper && above === upper.block) ctx.world.set_block(block.x, block.y + 1, block.z, "cubi:air");
return;
}
// the top needs room, like farmer's delight's rice
if (above !== upper.block && above !== "bworld:air") {
if (above !== upper.block && above !== "cubi:air") {
ctx.world.set_state(block.x, block.y, block.z, "age", params.stages - 1);
return;
}
@@ -770,7 +770,7 @@ function register_farming(ctx: ServerContext) {
const leaves = params.leaves;
// after it's gone, it's still there while on_break runs
ctx.system.run_timeout(() => {
if (ctx.world.get_block(x, y, z) === "bworld:air") ctx.world.set_block(x, y, z, leaves);
if (ctx.world.get_block(x, y, z) === "cubi:air") ctx.world.set_block(x, y, z, leaves);
}, 0);
}
},
@@ -837,7 +837,7 @@ function register_buckets(ctx: ServerContext) {
if (ctx.world.get_block(x, y, z) === block.id) {
// only a fluid's source fills it, not where it's flowing
if ((ctx.world.get_state(x, y, z, "level") ?? 0) !== 0) return false;
ctx.world.set_block(x, y, z, "bworld:air");
ctx.world.set_block(x, y, z, "cubi:air");
} else {
// the fluid in a waterlogged block, like a fence in water, which stays
ctx.world.set_state(x, y, z, "waterlogged", 0);
@@ -1050,7 +1050,7 @@ interface GrowableBlockParams {
function register_growable_block(ctx: ServerContext) {
ctx.components.register_block<GrowableBlockParams>("bworld:growable_block", {
on_new_day(block, params, day) {
if (ctx.world.get_block(block.x, block.y + 1, block.z) !== "bworld:air") {
if (ctx.world.get_block(block.x, block.y + 1, block.z) !== "cubi:air") {
return;
}
const should_grow_today = day % params.days === 0;
@@ -1083,7 +1083,7 @@ function register_door(ctx: ServerContext) {
const is_door = (id: string) => DOOR in ctx.blocks.components(id);
ctx.events.before.block_place.subscribe((event) => {
const { id, x, y, z } = event.block;
if (is_door(id) && ctx.world.get_block(x, y + 1, z) !== "bworld:air") event.cancel = true;
if (is_door(id) && ctx.world.get_block(x, y + 1, z) !== "cubi:air") event.cancel = true;
});
ctx.events.after.block_place.subscribe(({ block: { id, x, y, z } }) => {
if (!is_door(id)) return;
@@ -1110,7 +1110,7 @@ function register_door(ctx: ServerContext) {
const halves = [`${x},${y},${z}`, `${x},${other},${z}`];
for (const half of halves) breaking.add(half);
try {
ctx.world.set_block(x, other, z, "bworld:air");
ctx.world.set_block(x, other, z, "cubi:air");
} finally {
for (const half of halves) breaking.delete(half);
}
+2 -2
View File
@@ -231,7 +231,7 @@ export function register_trees(gen: WorldgenContext) {
return;
}
const current = chunk.get_block(x, y, z);
if (current === "bworld:air" || (block === "log" && LEAVES.has(current!))) chunk.set_block(x, y, z, id);
if (current === "cubi:air" || (block === "log" && LEAVES.has(current!))) chunk.set_block(x, y, z, id);
};
for (const site of tree_sites(chunk)) {
@@ -242,7 +242,7 @@ export function register_trees(gen: WorldgenContext) {
const ground_y = chunk.height_at(site.x, site.z);
const ground = chunk.get_block(site.x, ground_y, site.z);
const above = chunk.get_block(site.x, ground_y + 1, site.z);
if (!SOIL.has(ground!) || above !== "bworld:air") continue;
if (!SOIL.has(ground!) || above !== "cubi:air") continue;
const kind = here.kinds[Math.floor(site.rng.next() * here.kinds.length)] as TreeKind;
// big oaks grow oak, every other kind its own wood, unless the biome says
+1 -1
View File
@@ -7,7 +7,7 @@ import type { Face, Id } from "bworld/shared";
import { FACES, type FacingParam, front_of, named_sides, OPPOSITE, type SideName, step } from "./sides.ts";
export const WIRE = "bworld:verdigris_wire";
export const AIR = "bworld:air";
export const AIR = "cubi:air";
export const MAX_POWER = 15;
// a bworld:verdigris_source's params, the block json's: something that gives power out of some of its sides
+1 -1
View File
@@ -35,7 +35,7 @@ function cactus(chunk: FeatureChunk) {
continue;
}
for (let y = ground + 1; y <= ground + height; y++) {
if (chunk.get_block(x, y, z) !== "bworld:air") {
if (chunk.get_block(x, y, z) !== "cubi:air") {
break;
}
chunk.set_block(x, y, z, "bworld:cactus");
+1 -1
View File
@@ -294,7 +294,7 @@ function register_press(ctx: ServerContext, compacting: ProcessingRecipe[]) {
ctx.world.entities_in(
{ x: block.x + inset, y: block.y - 1 + inset, z: block.z + inset },
{ x: block.x + 1 - inset, y: block.y - inset, z: block.z + 1 - inset },
"bworld:item",
"cubi:item",
).filter((item) => item.on_ground && pressing_for(item.get_item()!.id));
const press = (item: EntityRef) => {
+1 -1
View File
@@ -99,7 +99,7 @@ export class ItemList {
// in the space from left to the window's right edge. returns the hovered item or fluid
render(g: Graphics, left: number, open: Open): Entry | undefined {
this.#entries ??= [
...this.ctx.items.ids().filter((id) => id !== "bworld:air").map((id) => ({ kind: "item" as const, id })),
...this.ctx.items.ids().filter((id) => id !== "cubi:air").map((id) => ({ kind: "item" as const, id })),
...this.ctx.fluids.ids().map((id) => ({ kind: "fluid" as const, id })),
];
left += GAP;