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 8d0dc3dd4..28190b88f 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 @@ -307,18 +307,27 @@ public class DepotBehaviour extends BlockEntityBehaviour { return returned; } - if (!simulate) { - if (this.isEmpty()) { - if (heldItem.insertedFrom.getAxis() - .isHorizontal()) - AllSoundEvents.DEPOT_SLIDE.playOnServer(getWorld(), getPos()); - else - AllSoundEvents.DEPOT_PLOP.playOnServer(getWorld(), getPos()); - } - this.heldItem = heldItem; - onHeldInserted.accept(heldItem.stack); + ItemStack returned = ItemStack.EMPTY; + int maxCount = heldItem.stack.getMaxStackSize(); + if (maxCount < heldItem.stack.getCount()) + returned = ItemHandlerHelper.copyStackWithSize(heldItem.stack, heldItem.stack.getCount() - maxCount); + + if (simulate) + return returned; + + if (this.isEmpty()) { + if (heldItem.insertedFrom.getAxis() + .isHorizontal()) + AllSoundEvents.DEPOT_SLIDE.playOnServer(getWorld(), getPos()); + else + AllSoundEvents.DEPOT_PLOP.playOnServer(getWorld(), getPos()); } - return ItemStack.EMPTY; + + heldItem = heldItem.copy(); + heldItem.stack.setCount(maxCount); + this.heldItem = heldItem; + onHeldInserted.accept(heldItem.stack); + return returned; } public void setHeldItem(TransportedItemStack heldItem) { diff --git a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java index 9773e9cf8..8f3c38f87 100644 --- a/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java +++ b/src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java @@ -23,6 +23,10 @@ public class FilterItemStack { public static FilterItemStack of(ItemStack filter) { if (filter.hasTag()) { + CompoundTag stackTag = filter.getTag(); + stackTag.remove("Enchantments"); + stackTag.remove("AttributeModifiers"); + if (AllItems.FILTER.isIn(filter)) return new ListFilterItemStack(filter); if (AllItems.ATTRIBUTE_FILTER.isIn(filter)) 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 ee4292c77..5bc0b5a53 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 (be instanceof BasinBlockEntity) + if (filter.isRecipeFilter()) filter = null; // Do not test spout outputs against the recipe filter IItemHandler targetInv = be == null ? null diff --git a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/filtering/FilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/filtering/FilteringBehaviour.java index 3d800183a..02e751dfa 100644 --- a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/filtering/FilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/filtering/FilteringBehaviour.java @@ -387,5 +387,9 @@ public class FilteringBehaviour extends BlockEntityBehaviour implements ValueSet return setFilter(side, copied); } + + public boolean isRecipeFilter() { + return recipeFilter; + } }