Fix item duplication with mutating inventories (#1433)

This commit is contained in:
Kogepan229 authored and GitHub committed 2026-07-12 22:17:26 +02:00
1 parent 9220db1fbe
commit b5a8505978
1 file changed
+2 -1
@@ -248,11 +248,12 @@ public class AdaptorIInventory extends InventoryAdaptor {
next.stackSize = Math.min(perOperationLimit, next.stackSize);
if (this.i.isItemValidForSlot(slot, next) && this.i.getStackInSlot(slot) == null) {
final int inserted = next.stackSize;
if (modulate) {
this.i.setInventorySlotContents(slot, next);
this.i.markDirty();
}
left.stackSize -= next.stackSize;
left.stackSize -= inserted;
if (left.stackSize <= 0) {
return null;