Disaster Depot

- Fixed bugs introduced by fa5b71b7eb
This commit is contained in:
simibubi 2024-09-02 23:55:51 +02:00
parent 9ce6f6f73f
commit d4a854fb6e
2 changed files with 8 additions and 4 deletions

View File

@ -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;

View File

@ -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