From bc053b26909b19703acd4255f4e6bb2dd47dc538 Mon Sep 17 00:00:00 2001 From: asdflj <854865755@qq.com> Date: Mon, 20 Feb 2023 11:35:36 +0800 Subject: [PATCH] fix fluid storage bus crash --- .../glodblock/github/common/parts/PartFluidStorageBus.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidStorageBus.java b/src/main/java/com/glodblock/github/common/parts/PartFluidStorageBus.java index 5b39f025..a6ea5d37 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidStorageBus.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidStorageBus.java @@ -259,7 +259,9 @@ public class PartFluidStorageBus extends PartUpgradeable @Override public void onNeighborChanged() { - BlockPos neighbor = new BlockPos(this.getTile()).getOffSet(this.getSide()); + TileEntity tile = this.getTile(); + if (tile == null || this.getProxy() == null || !this.getProxy().isActive()) return; + BlockPos neighbor = new BlockPos(tile).getOffSet(this.getSide()); final TileEntity te = neighbor.getTileEntity(); // In case the TE was destroyed, we have to do a full reset immediately. if (te instanceof TileCableBus) { @@ -288,6 +290,7 @@ public class PartFluidStorageBus extends PartUpgradeable } else { this.resetCache(false); } + } @Override