From e8b57c6dc5bfa83a7279ee9c443379a1610793ae Mon Sep 17 00:00:00 2001 From: shartte Date: Fri, 17 Jul 2020 22:35:49 +0200 Subject: [PATCH] Multiblocks sometimes can't be broken because during removal, (#4469) they update their own block-state to display the disconnected state, effectively reversing their own removal. This occurs because the cached block state in the tile entity base class is outdated and doesn't reflect the removal. --- src/main/java/appeng/tile/crafting/CraftingTileEntity.java | 5 +++++ src/main/java/appeng/tile/qnb/QuantumBridgeTileEntity.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/appeng/tile/crafting/CraftingTileEntity.java b/src/main/java/appeng/tile/crafting/CraftingTileEntity.java index 47c153550..69f90421c 100644 --- a/src/main/java/appeng/tile/crafting/CraftingTileEntity.java +++ b/src/main/java/appeng/tile/crafting/CraftingTileEntity.java @@ -246,6 +246,11 @@ public class CraftingTileEntity extends AENetworkTileEntity implements IAEMultiB } public void breakCluster() { + // Since breaking the cluster will most likely also update the TE's state, + // it's essential that we're not working with outdated block-state information, + // since this particular TE's block might already have been removed (state=air) + updateContainingBlockInfo(); + if (this.cluster != null) { this.cluster.cancel(); final IMEInventory inv = this.cluster.getInventory(); diff --git a/src/main/java/appeng/tile/qnb/QuantumBridgeTileEntity.java b/src/main/java/appeng/tile/qnb/QuantumBridgeTileEntity.java index f625a6bfd..c79320a59 100644 --- a/src/main/java/appeng/tile/qnb/QuantumBridgeTileEntity.java +++ b/src/main/java/appeng/tile/qnb/QuantumBridgeTileEntity.java @@ -289,6 +289,11 @@ public class QuantumBridgeTileEntity extends AENetworkInvTileEntity implements I } public void breakCluster() { + // Since breaking the cluster will most likely also update the TE's state, + // it's essential that we're not working with outdated block-state information, + // since this particular TE's block might already have been removed (state=air) + updateContainingBlockInfo(); + if (this.cluster != null) { this.cluster.destroy(); }