From ee212cff9e2ed44d1661f821ef9929938d5c43d7 Mon Sep 17 00:00:00 2001 From: direwolf20 <39863894+Direwolf20-MC@users.noreply.github.com> Date: Fri, 18 Oct 2024 21:03:55 -0400 Subject: [PATCH] Check for Empty Item Entities in ItemCollector - resolves #213 --- .../justdirethings/common/blockentities/ItemCollectorBE.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/direwolf20/justdirethings/common/blockentities/ItemCollectorBE.java b/src/main/java/com/direwolf20/justdirethings/common/blockentities/ItemCollectorBE.java index 3100edc0..0de5a0dc 100644 --- a/src/main/java/com/direwolf20/justdirethings/common/blockentities/ItemCollectorBE.java +++ b/src/main/java/com/direwolf20/justdirethings/common/blockentities/ItemCollectorBE.java @@ -108,7 +108,7 @@ private void findItemsAndStore() { if (respectPickupDelay && itemEntity.hasPickUpDelay()) continue; ItemStack stack = itemEntity.getItem(); - if (!isStackValidFilter(stack)) continue; + if (stack.isEmpty() || !isStackValidFilter(stack)) continue; ItemStack leftover = ItemHandlerHelper.insertItemStacked(handler, stack, false); if (leftover.isEmpty()) { // If the stack is now empty, remove the ItemEntity from the collection