extends Resource class_name RecipePart @export var item : Comparable @export var amount : int func is_stack_sufficient(stack: Stack) -> bool: return item.is_equal(stack.held_item) and stack.amount >= amount func consume_stack(stack: Stack) -> bool: if is_stack_sufficient(stack) == false: return false stack.amount -= amount return true func create_stack() -> Stack: if item is Item: return Stack.new(item,amount) elif item is ItemTag: return Stack.new(item.items[randi_range(0,len(item.items))],amount) return null