Smithing table

This commit is contained in:
2026-09-25 23:48:29 -03:00
parent 9237152aa1
commit 8f32a59bd6
15 changed files with 279 additions and 13 deletions
+3 -2
View File
@@ -12,7 +12,7 @@ import {
TICKS_PER_SECOND,
} from "$/common/constants.ts";
import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts";
import { click_slot, Container, ItemData, ItemStack, take_output } from "$/common/inventory.ts";
import { can_take_output, click_slot, Container, ItemData, ItemStack, take_output } from "$/common/inventory.ts";
import {
AIR_ID,
BlockChange,
@@ -744,7 +744,8 @@ export class GameServer {
}
} else if (key === "screen" && player.screen?.layout.slots.find((s) => s.index === index)?.output) {
const item = container.get_item(index);
if (item && take_output(item, player.cursor)) {
const allowed = (item: ItemStack) => player.screen?.on_take.get(index)?.(item) ?? true;
if (item && can_take_output(item, player.cursor) && allowed(item) && take_output(item, player.cursor)) {
container.set_item(index, undefined);
}
} else if (