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
+2 -2
View File
@@ -172,12 +172,12 @@ have a `push` too, see [Players](players.md#pushing).
Minecraft's `getEntitiesOfClass`, only the ones of `type` when it's given. Players aren't among them, they're in
`ctx.players`.
Items lying around are entities of type `bworld:item`. A machine that works on them, like a press, finds them, changes
Items lying around are entities of type `cubi:item`. A machine that works on them, like a press, finds them, changes
them with `set_item`, and adds what it made with `ctx.world.spawn_item`, which lays an item down still where it's put,
unlike `drop_item`, which pops it out of a block:
```ts
const [item] = ctx.world.entities_in({ x, y: y - 1, z }, { x: x + 1, y, z: z + 1 }, "bworld:item");
const [item] = ctx.world.entities_in({ x, y: y - 1, z }, { x: x + 1, y, z: z + 1 }, "cubi:item");
const stack = item?.get_item();
if (stack?.id === "bworld:iron_ingot") {
item.set_item(stack.count > 1 ? { ...stack, count: stack.count - 1 } : undefined);