Skip to content

Commit

Permalink
move voiding logic to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Sep 11, 2023
1 parent f1029db commit 07e206a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,6 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack insertedStack, boolean
if (insertedStack.getCount() - amountInsertedIntoExport > virtualizedAmount) {
remainingStack = insertedStack.copy();
remainingStack.setCount(insertedStack.getCount() - virtualizedAmount);

if (voiding && virtualizedAmount == 0) {
return ItemStack.EMPTY;
}
}

if (!simulate) {
Expand All @@ -644,7 +640,11 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack insertedStack, boolean
}
}

return remainingStack;
if (voiding && itemsStoredInside == maxStoredItems) {
return ItemStack.EMPTY;
} else {
return remainingStack;
}
}
}

Expand Down

0 comments on commit 07e206a

Please sign in to comment.