Stonecutter

This commit is contained in:
2026-10-12 20:52:41 -03:00
parent 02cbeda0a0
commit bea5f10a12
20 changed files with 411 additions and 6 deletions
+1
View File
@@ -195,6 +195,7 @@ catch up. If it's further behind than that, it skips the rest and logs a warning
| `bworld:shipping_bin` | `rows` | Like `bworld:storage`, and every morning at 06:00 sells what's in it with a `base_sell_value` for coins. |
| `bworld:furnace` | none | Smelts with `furnace` and `fuel` [recipes](../resources/recipes.md). Needs `lit` and `facing` states, see `blocks/furnace.json`. |
| `bworld:smithing_table` | none | Upgrades tools with `smithing` recipes. |
| `bworld:stonecutter` | none | Cuts one item into another with `bworld:stonecutting` recipes, picked from a list. |
| `bworld:hoeable` | `tool`, `into` | Right clicking with a tool of type `tool` turns it into `into`, like a hoe on grass. |
| `bworld:farmland` | none | Watered with the watering can, dries out every morning. |
| `bworld:crop` | see [Crops](crops.md) | Grows a stage every morning its farmland was watered. |
+4
View File
@@ -175,11 +175,15 @@ interface ClientMenu {
readonly title: string;
readonly open_data: unknown;
readonly data: Readonly<Record<string, number>>; // the server's latest add_data values
item(slot: number): ItemStack | undefined; // what's in a slot, by menu slot index, a copy
click_button(id: number): void;
close(): void;
}
```
`item` is for screens that draw something from what's in the slots, like NeoForge screens reading `menu.slots`: the
stonecutter's lists what its input can be cut into.
When the server opens a menu type the client has no screen for, the client closes it again, with an error in its
console. A screen that throws is closed the same way.
+19
View File
@@ -66,6 +66,25 @@ An optional `addition` is a third item it also takes. Upgrading uses up the tool
addition, and the result keeps the tool's `data`, like its [durability](../items/tools.md#durability). Two smithing
recipes with the same tool, material and addition are an error.
## Stonecutting: `bworld:stonecutting`
For the stonecutter, which cuts one item into another. It's the base game's own type, so `mods/bworld` checks these
recipes when the server starts rather than the engine:
```json
{
"format_version": 1,
"recipe": {
"type": "bworld:stonecutting",
"input": "bworld:cobblestone",
"output": { "id": "bworld:stone_bricks", "count": 1 }
}
}
```
Every recipe that takes the item in the stonecutter's input is listed, in load order, and the player picks one. Each cut
uses up one of the input.
## Choices
Anywhere a recipe takes an item (`key` values, `input`, `item`), an item [tag](tags.md) means anything in it fits, and