Skip to content

Commit ff286d0

Browse files
authored
Fix iron barrel voiding items on GUI click when full (#1041)
1 parent 8214de1 commit ff286d0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/aztech/modern_industrialization/items/ItemContainingItemHelper.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ default boolean handleClick(Player player, ItemStack barrelLike, Mutable<ItemSta
8282
if (!heldStack.isEmpty()) {
8383
if (otherStack.getValue().isEmpty() || ItemStack.isSameItemSameComponents(heldStack, otherStack.getValue())) {
8484
var extracted = barrelHandler.extractItem(0, heldStack.getMaxStackSize() - otherStack.getValue().getCount(), false);
85-
extracted.grow(otherStack.getValue().getCount()); // Grow by existing items
86-
otherStack.setValue(extracted);
87-
return true;
85+
if (extracted.getCount() > 0) {
86+
extracted.grow(otherStack.getValue().getCount()); // Grow by existing items
87+
otherStack.setValue(extracted);
88+
return true;
89+
}
8890
}
8991
}
9092

0 commit comments

Comments
 (0)