diff --git a/src/inventory.rs b/src/inventory.rs index b1e46cd..f5dd915 100644 --- a/src/inventory.rs +++ b/src/inventory.rs @@ -208,8 +208,12 @@ impl Inventory { ), ); } else { - other_inventory.replace_slot_item_stack(end_slot, start_slot_itemstack); - self.replace_slot_item_stack(start_slot, end_slot_itemstack); + if end_slot_itemstack.amount as usize != end_max_stack_amount + || end_slot_itemstack.item_type == ItemType::Air + { + other_inventory.replace_slot_item_stack(end_slot, start_slot_itemstack); + self.replace_slot_item_stack(start_slot, end_slot_itemstack); + } } } } @@ -366,7 +370,11 @@ impl Inventory { ), ); } else { - self.swap_slots(start_slot, end_slot); + if end_slot_itemstack.amount as usize != end_max_stack_amount + || end_slot_itemstack.item_type == ItemType::Air + { + self.swap_slots(start_slot, end_slot); + } } } }