Skip to content

Commit

Permalink
only access worldpipenet on server
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 committed Dec 18, 2023
1 parent e54bb80 commit 5fe4d28
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/gregtech/api/pipenet/tile/TileEntityPipeBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,12 @@ public boolean shouldRefresh(@NotNull World world, @NotNull BlockPos pos, IBlock
@Override
public void onChunkUnload() {
super.onChunkUnload();
WorldPipeNet<?, ?> worldPipeNet = getPipeBlock().getWorldPipeNet(getWorld());
PipeNet<?> net = worldPipeNet.getNetFromPos(pos);
if (net != null) {
net.onChunkUnload();
if (!world.isRemote) {
WorldPipeNet<?, ?> worldPipeNet = getPipeBlock().getWorldPipeNet(getWorld());
PipeNet<?> net = worldPipeNet.getNetFromPos(pos);
if (net != null) {
net.onChunkUnload();
}
}
}

Expand Down

0 comments on commit 5fe4d28

Please sign in to comment.