diff --git a/common/src/main/java/dev/dubhe/anvilcraft/api/depository/ItemDepositoryHelper.java b/common/src/main/java/dev/dubhe/anvilcraft/api/depository/ItemDepositoryHelper.java index 691f95616..17285cc4f 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/api/depository/ItemDepositoryHelper.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/api/depository/ItemDepositoryHelper.java @@ -60,8 +60,9 @@ public static void exportToTarget( int amountToInsert = sourceStack.getCount() - remainder.getCount(); if (amountToInsert > 0) { sourceStack = source.extract(srcIndex, Math.min(maxAmount, amountToInsert), false); - insertItem(target, sourceStack, false); + remainder = insertItem(target, sourceStack, false); maxAmount -= Math.min(maxAmount, amountToInsert); + source.insert(srcIndex, remainder, false); } if (maxAmount <= 0) return; }