Smithing table
This commit is contained in:
@@ -258,6 +258,12 @@ function right_click(container: Container, index: number, cursor: Cursor) {
|
||||
slot.amount = half;
|
||||
}
|
||||
|
||||
// whether take_output would take it
|
||||
export function can_take_output(item: ItemStack, cursor: Cursor): boolean {
|
||||
const holding = cursor.item;
|
||||
return !holding || (holding.type_id === item.type_id && holding.max_amount - holding.amount >= item.amount);
|
||||
}
|
||||
|
||||
// output slots (furnace result, crafting result) can only be taken from, all at once
|
||||
// returns whether it was taken
|
||||
export function take_output(item: ItemStack, cursor: Cursor): boolean {
|
||||
|
||||
Reference in New Issue
Block a user