Skip to content

Commit

Permalink
Correctly invert validity check
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIllusiveC4 committed Dec 25, 2023
1 parent d2fc82d commit 386cd4e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private static void replaceInvalidStacks(ServerPlayer player, String id,
for (int i = 0; i < stacks.getSlots(); i++) {
ItemStack stack = stacks.getStackInSlot(i);

if (!stack.isEmpty() && stacks.isItemValid(i, stack)) {
if (!stack.isEmpty() && !stacks.isItemValid(i, stack)) {
stacks.setStackInSlot(i, ItemStack.EMPTY);
ItemHandlerHelper.giveItemToPlayer(player, stack);
}
Expand Down

0 comments on commit 386cd4e

Please sign in to comment.