diff --git a/src/main/java/com/simibubi/create/content/logistics/depot/DepotBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/depot/DepotBehaviour.java index 28190b88f..55493a0a9 100644 --- a/src/main/java/com/simibubi/create/content/logistics/depot/DepotBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/depot/DepotBehaviour.java @@ -309,7 +309,8 @@ public class DepotBehaviour extends BlockEntityBehaviour { ItemStack returned = ItemStack.EMPTY; int maxCount = heldItem.stack.getMaxStackSize(); - if (maxCount < heldItem.stack.getCount()) + boolean stackTooLarge = maxCount < heldItem.stack.getCount(); + if (stackTooLarge) returned = ItemHandlerHelper.copyStackWithSize(heldItem.stack, heldItem.stack.getCount() - maxCount); if (simulate) @@ -323,8 +324,11 @@ public class DepotBehaviour extends BlockEntityBehaviour { AllSoundEvents.DEPOT_PLOP.playOnServer(getWorld(), getPos()); } - heldItem = heldItem.copy(); - heldItem.stack.setCount(maxCount); + if (stackTooLarge) { + heldItem = heldItem.copy(); + heldItem.stack.setCount(maxCount); + } + this.heldItem = heldItem; onHeldInserted.accept(heldItem.stack); return returned; diff --git a/src/main/java/com/simibubi/create/content/processing/basin/BasinBlockEntity.java b/src/main/java/com/simibubi/create/content/processing/basin/BasinBlockEntity.java index 5bc0b5a53..54db269a5 100644 --- a/src/main/java/com/simibubi/create/content/processing/basin/BasinBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/processing/basin/BasinBlockEntity.java @@ -380,7 +380,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf inserter = BlockEntityBehaviour.get(level, be.getBlockPos(), InvManipulationBehaviour.TYPE); } - if (filter.isRecipeFilter()) + if (filter != null && filter.isRecipeFilter()) filter = null; // Do not test spout outputs against the recipe filter IItemHandler targetInv = be == null ? null