From 5c3c188193ddd0968a7c9716c932076fbc60791d Mon Sep 17 00:00:00 2001 From: Thiakil Date: Thu, 12 Dec 2024 18:34:11 +0800 Subject: [PATCH] avoid more race conditions in transmitter render --- .../client/render/transmitter/RenderMechanicalPipe.java | 3 +++ .../client/render/transmitter/RenderPressurizedTube.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/mekanism/client/render/transmitter/RenderMechanicalPipe.java b/src/main/java/mekanism/client/render/transmitter/RenderMechanicalPipe.java index d75530b9434..9c3e5eb84ca 100644 --- a/src/main/java/mekanism/client/render/transmitter/RenderMechanicalPipe.java +++ b/src/main/java/mekanism/client/render/transmitter/RenderMechanicalPipe.java @@ -58,6 +58,9 @@ protected void render(TileEntityMechanicalPipe tile, float partialTick, PoseStac ProfilerFiller profiler) { MechanicalPipe pipe = tile.getTransmitter(); FluidNetwork network = pipe.getTransmitterNetwork(); + if (network == null) { + return;//race conditions + } FluidStack fluidStack = network.lastFluid; if (fluidStack.isEmpty()) { //Shouldn't be the case but validate it diff --git a/src/main/java/mekanism/client/render/transmitter/RenderPressurizedTube.java b/src/main/java/mekanism/client/render/transmitter/RenderPressurizedTube.java index 1fd9dfcdc63..8084b4a23c7 100644 --- a/src/main/java/mekanism/client/render/transmitter/RenderPressurizedTube.java +++ b/src/main/java/mekanism/client/render/transmitter/RenderPressurizedTube.java @@ -26,6 +26,9 @@ public RenderPressurizedTube(BlockEntityRendererProvider.Context context) { protected void render(TileEntityPressurizedTube tile, float partialTick, PoseStack matrix, MultiBufferSource renderer, int light, int overlayLight, ProfilerFiller profiler) { BoxedChemicalNetwork network = tile.getTransmitter().getTransmitterNetwork(); + if (network == null) { + return;//race conditions, yay + } matrix.pushPose(); matrix.translate(0.5, 0.5, 0.5); Chemical chemical = network.lastChemical.getChemical();