preserve crafting tool inventory origin after use (#339)

This commit is contained in:
Pxx500 authored and GitHub committed 2026-09-13 17:54:36 +02:00
1 parent 278291fbd8
commit 73acc41d1b
1 file changed
+5
@@ -332,6 +332,11 @@ public class CraftingStationContainer extends Container {
}
ItemStack previous = before[i];
if (clickedSlot == CRAFTING_RESULT_SLOT && previous != null && previous.getItem() == current.getItem()) {
// Crafting can return the same tool with different damage or NBT.
logic.setSideInventoryPreference(slot, preferencesBefore[i]);
continue;
}
boolean receivedCarriedStack = (mode == CLICK_MODE_PICKUP && slot == clickedSlot || mode == CLICK_MODE_DRAG)
&& carriedBefore != null
&& stacksCanMerge(current, carriedBefore);