Add isItemValid check for ItemStackHandler (#5850)
This commit is contained in:
parent
73bb18e78b
commit
b2a5d34679
1 changed files with 3 additions and 0 deletions
|
@ -81,6 +81,9 @@ public class ItemStackHandler implements IItemHandler, IItemHandlerModifiable, I
|
||||||
if (stack.isEmpty())
|
if (stack.isEmpty())
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
|
|
||||||
|
if (!isItemValid(slot, stack))
|
||||||
|
return stack;
|
||||||
|
|
||||||
validateSlotIndex(slot);
|
validateSlotIndex(slot);
|
||||||
|
|
||||||
ItemStack existing = this.stacks.get(slot);
|
ItemStack existing = this.stacks.get(slot);
|
||||||
|
|
Loading…
Reference in a new issue