Fix channels reappearing when the neighbor invalidates and the garbage collector has not run yet
@@ -88,6 +88,7 @@ public class ChannelTileEntity extends MantleTileEntity implements ITickableTile
/** Called when a capability invalidates to clear the given side */
private void invalidateSide(Direction side, LazyOptional<IFluidHandler> capability) {
+ if (!this.isRemoved()) {
if (neighborTanks.get(side) == capability) {
neighborTanks.remove(side);
// update the block state to no longer be pointing in that direction
@@ -96,7 +97,8 @@ public class ChannelTileEntity extends MantleTileEntity implements ITickableTile
if (side == Direction.DOWN) {
world.setBlockState(pos, currentState.with(ChannelBlock.DOWN, false));
} else {
- world.setBlockState(pos, getBlockState().with(ChannelBlock.DIRECTION_MAP.get(side), ChannelConnection.NONE));
+ world.setBlockState(pos, currentState.with(ChannelBlock.DIRECTION_MAP.get(side), ChannelConnection.NONE));
+ }
}
}
}
