Skip to content

Commit 2020720

Browse files
committed
Add blank check to insertItem() method
1 parent c73360d commit 2020720

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fabric-transfer-api-v1/src/main/java/org/sinytra/fabric/transfer_api/compat/ItemStorageItemHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public int getSlots() {
4444
public @NotNull ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) {
4545
try (Transaction transaction = Transaction.openOuter()) {
4646
ItemVariant resource = ItemVariant.of(stack);
47+
if (resource.isBlank()) return ItemStack.EMPTY;
4748
int inserted = (int) storage.insert(resource, stack.getCount(), transaction);
4849
if (!simulate) {
4950
transaction.commit();

0 commit comments

Comments
 (0)