Fixes #3688: Invalidate Storage Bus cache immediately upon missing TE. (#3737)

This commit is contained in:
yueh
2018-09-28 17:36:58 +02:00
committed by GitHub
parent 37d8833b95
commit 038ca23523
@@ -287,10 +287,21 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor ) public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor )
{ {
if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) )
{
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 ); this.resetCache( false );
} }
} }
}
@Override @Override
public float getCableConnectionLength( AECableType cable ) public float getCableConnectionLength( AECableType cable )