Skip to content

Commit

Permalink
avoid more race conditions in transmitter render
Browse files Browse the repository at this point in the history
(cherry picked from commit 5c3c188)
  • Loading branch information
thiakil committed Dec 15, 2024
1 parent e7febd3 commit 5633032
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5633032

Please sign in to comment.