From d4a854fb6ed7f97b2d43310345f1d5d89702224c Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:55:51 +0200 Subject: [PATCH] Disaster Depot - Fixed bugs introduced by fa5b71b7eba348fcbd64eabd6c09bfcd9fa49bbe --- .../create/content/logistics/depot/DepotBehaviour.java | 10 +++++++--- .../content/processing/basin/BasinBlockEntity.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) 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