/// Adds an item to a stack.
Adds an item to a stack.
Adds an item to a stack .
fn add_to_stack<A: Array<Item = SlotIndex>>(
        &mut self,
        item: &mut ItemStack,
        slot_item: &ItemStack,
        slot: SlotIndex,
        affected_slots: &mut SmallVec<A>,
    ) {
        let added = min(item.amount, max_size(item.ty) - slot_item.amount);
        item.amount -= added;
        self.set_item_at(slot, ItemStack::new(slot_item.ty, slot_item.amount + added));
        affected_slots.push(slot);
    }
fn add_to_stack < A : Array < Item = SlotIndex > > ( & mut self , item : & mut ItemStack , slot_item : & ItemStack , slot : SlotIndex , affected_slots : & mut SmallVec < A > , ) { let added = min ( item . amount , max_size ( item . ty ) - slot_item . amount ) ; item . amount -= added ; self . set_item_at ( slot , ItemStack :: new ( slot_item . ty , slot_item . amount + added ) ) ; affected_slots . push ( slot ) ; }
Adds an item to a stack.
Adds an item to a stack .
&mut self
item
&mut ItemStack
slot_item
&ItemStack
slot
SlotIndex
affected_slots
&mut SmallVec<A>