Recipe types from shared scripts and stuff
This commit is contained in:
@@ -22,8 +22,8 @@ export function setup(ctx: ServerContext) {
|
||||
const smelter = ctx.menus.register<BlockRef>("copper_tools:smelter", (menu, block, player) => {
|
||||
const container = ctx.containers.get(block.data.container)!;
|
||||
menu.title = "Smelter";
|
||||
menu.add_slot(container, 0, { x: 55, y: 16, filter: "smeltable" });
|
||||
menu.add_slot(container, 1, { x: 55, y: 52, filter: "fuel" });
|
||||
menu.add_slot(container, 0, { x: 55, y: 16, filter: (item) => !!ctx.recipes.find("bworld:smelting", item.id) });
|
||||
menu.add_slot(container, 1, { x: 55, y: 52, filter: (item) => !!ctx.recipes.find("bworld:fuel", item.id) });
|
||||
menu.add_slot(container, 2, { x: 115, y: 34, output_only: true });
|
||||
menu.add_player_inventory(7, 84);
|
||||
menu.add_data("progress", () => block.data.progress);
|
||||
@@ -57,7 +57,7 @@ returns the slot's **menu slot index**: slots are numbered in the order they're
|
||||
| Option | Meaning |
|
||||
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| `x`, `y` | Where its 18 pixel frame goes, in GUI pixels from the screen's top left. |
|
||||
| `filter` | What can be put in: `"smeltable"` (has a furnace recipe), `"fuel"`, or a function `(item) => boolean`. |
|
||||
| `filter` | What can be put in: a function `(item) => boolean`, like one that looks for a [recipe](../resources/recipes.md). |
|
||||
| `output_only` | Can only be taken from, all at once, like the furnace result. |
|
||||
| `on_take` | For `output_only` slots: runs when a player takes from it, before they get the item. Return `false` to stop them. |
|
||||
| `icon` | A texture drawn in the slot while it's empty, like Minecraft's armor slots. |
|
||||
|
||||
Reference in New Issue
Block a user