From 038ca23523b879f513fdec0795ae281f20209186 Mon Sep 17 00:00:00 2001 From: yueh Date: Fri, 28 Sep 2018 17:36:58 +0200 Subject: [PATCH] Fixes #3688: Invalidate Storage Bus cache immediately upon missing TE. (#3737) --- src/main/java/appeng/parts/misc/PartStorageBus.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/appeng/parts/misc/PartStorageBus.java b/src/main/java/appeng/parts/misc/PartStorageBus.java index 55ee72948..9441a9dc8 100644 --- a/src/main/java/appeng/parts/misc/PartStorageBus.java +++ b/src/main/java/appeng/parts/misc/PartStorageBus.java @@ -288,7 +288,18 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC { if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) { - this.resetCache( false ); + final TileEntity te = w.getTileEntity( neighbor ); + + // In case the TE was destroyed, we have to do a full reset immediately. + if( te == null ) + { + this.resetCache( true ); + this.resetCache(); + } + else + { + this.resetCache( false ); + } } }