From 5633032851f7feb7686060fb23efd76ad8573e4c 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 (cherry picked from commit 5c3c188193ddd0968a7c9716c932076fbc60791d) --- .../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 fb8c7b218c7..c5de364ddbb 100644 --- a/src/main/java/mekanism/client/render/transmitter/RenderMechanicalPipe.java +++ b/src/main/java/mekanism/client/render/transmitter/RenderMechanicalPipe.java @@ -59,6 +59,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 139bd885925..66a753d1654 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) { ChemicalNetwork 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();