From 4aa44f1a3a7daced7a56894f533a86933548fcfd Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sun, 9 Jan 2022 15:42:01 +0100 Subject: [PATCH] Misc Patches - Fixed Brass funnels with configured amounts inserting partial stacks when target inventory is almost full #2589 - Fixed toolbox not marking a chunk for saving when contents change #2574 - Fixed Contraptions no longer sending disassembly packets and thus dropping players through blocks #2538 --- .../structureMovement/AbstractContraptionEntity.java | 6 +++--- .../belt/transport/BeltFunnelInteractionHandler.java | 9 ++++++++- .../content/curiosities/toolbox/ToolboxInventory.java | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java index 119a41f73..07a1d4811 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java @@ -441,13 +441,13 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit return; if (contraption == null) return; - - discard(); - + StructureTransform transform = makeStructureTransform(); AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), new ContraptionDisassemblyPacket(this.getId(), transform)); + discard(); + contraption.addBlocksToWorld(level, transform); contraption.addPassengersToWorld(level, transform, getPassengers()); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltFunnelInteractionHandler.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltFunnelInteractionHandler.java index e4b94be27..52f0cbe7a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltFunnelInteractionHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltFunnelInteractionHandler.java @@ -80,8 +80,15 @@ public class BeltFunnelInteractionHandler { else continue; - if (amountToExtract != -1) + if (amountToExtract != -1) { toInsert.setCount(amountToExtract); + ItemStack remainder = inserting.simulate().insert(toInsert); + if (!remainder.isEmpty()) + if (blocking) + return true; + else + continue; + } ItemStack remainder = inserting.insert(toInsert); if (toInsert.equals(remainder, false)) diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java index b5c7e4674..48e6d0b08 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java @@ -147,6 +147,7 @@ public class ToolboxInventory extends ItemStackHandler { if (!settling && !te.getLevel().isClientSide) settle(slot / STACKS_PER_COMPARTMENT); te.sendData(); + te.setChanged(); super.onContentsChanged(slot); }