Skip to content

Commit 55f0bf3

Browse files
authored
fix QuantumChestItemHandler (GregTechCEu#2034)
1 parent b8c7c30 commit 55f0bf3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumChest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) {
527527
@Nonnull
528528
@Override
529529
public ItemStack insertItem(int slot, @Nonnull ItemStack insertedStack, boolean simulate) {
530-
531530
if (insertedStack.isEmpty()) {
532531
return ItemStack.EMPTY;
533532
}
@@ -562,9 +561,8 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack insertedStack, boolean
562561
long amountLeftInChest = itemStack.isEmpty() ? maxStoredItems : maxStoredItems - itemsStoredInside;
563562
virtualizedAmount = (int) Math.min(insertedStack.getCount() - amountInsertedIntoExport, amountLeftInChest);
564563

565-
}
566-
// Return early, as we did not virtualize anything, as it all fit into the output slot
567-
else {
564+
} else {
565+
// Return early, as we did not virtualize anything, as it all fit into the output slot
568566
return MetaTileEntityQuantumChest.this.exportItems.insertItem(0, insertedStack, simulate);
569567
}
570568

@@ -591,9 +589,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack insertedStack, boolean
591589
insertedStackCopy.setCount(amountInsertedIntoExport);
592590
MetaTileEntityQuantumChest.this.exportItems.insertItem(0, insertedStackCopy, simulate);
593591
}
594-
return insertedStack;
595-
}
596-
else {
592+
} else {
597593
MetaTileEntityQuantumChest.this.itemsStoredInside += remainingStack.getCount();
598594
}
599595
}

0 commit comments

Comments
 (0)