From b7a475266f49d0fc8c872057ad9c095fe20ab0a4 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Mon, 16 May 2016 21:48:33 +0200 Subject: [PATCH] Fix bug with destructor removing itself from the network --- src/main/java/refinedstorage/tile/TileDestructor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/refinedstorage/tile/TileDestructor.java b/src/main/java/refinedstorage/tile/TileDestructor.java index a04c94476..6371421d3 100755 --- a/src/main/java/refinedstorage/tile/TileDestructor.java +++ b/src/main/java/refinedstorage/tile/TileDestructor.java @@ -37,7 +37,10 @@ public class TileDestructor extends TileMachine implements ICompareConfig, IMode @Override public void updateMachine() { - if (ticks % RefinedStorageUtils.getSpeed(upgradesInventory, BASE_SPEED, 4) == 0) { + // We check if the controller isn't null here because + // when a destructor faces a storage network block and removes it + // it will essentially remove itself from the network without knowing. + if (controller != null && ticks % RefinedStorageUtils.getSpeed(upgradesInventory, BASE_SPEED, 4) == 0) { BlockPos front = pos.offset(getDirection()); IBlockState frontBlockState = worldObj.getBlockState(front);