diff --git a/src/main/java/com/cleanroommc/bogosorter/ShortcutHandler.java b/src/main/java/com/cleanroommc/bogosorter/ShortcutHandler.java index eed3fa9..633d990 100644 --- a/src/main/java/com/cleanroommc/bogosorter/ShortcutHandler.java +++ b/src/main/java/com/cleanroommc/bogosorter/ShortcutHandler.java @@ -115,7 +115,7 @@ public static void moveAllItems(EntityPlayer player, Container container, ISlot } else { int inserted = stackInSlot.stackSize - remainder.stackSize; if (inserted > 0) { - slot1.bogo$putStack(remainder.stackSize > 0 ? remainder : null); + slot1.bogo$putStack(remainder.copy()); } } } diff --git a/src/main/java/com/cleanroommc/bogosorter/common/refill/DamageHelper.java b/src/main/java/com/cleanroommc/bogosorter/common/refill/DamageHelper.java index b5e9602..3ca839a 100644 --- a/src/main/java/com/cleanroommc/bogosorter/common/refill/DamageHelper.java +++ b/src/main/java/com/cleanroommc/bogosorter/common/refill/DamageHelper.java @@ -14,6 +14,10 @@ public static boolean damageItemHook(ItemStack itemStack, EntityPlayer player) { if (!playerConfig.enableAutoRefill || playerConfig.autoRefillDamageThreshold <= 0) return false; if (RefillHandler.shouldHandleRefill(player, itemStack) && isNotArmor(itemStack)) { + ItemStack handItem = player.getHeldItem(); + if (handItem != itemStack) { + return false; + } int durabilityLeft = itemStack.getMaxDamage() - itemStack.getItemDamage(); if (durabilityLeft >= 0 && durabilityLeft < playerConfig.autoRefillDamageThreshold) { return RefillHandler.handle(player.inventory.currentItem, itemStack, player, true);