Skip to content

Commit

Permalink
avoid more race conditions in transmitter render
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Dec 12, 2024
1 parent e22a5ed commit 5c3c188
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 @@ -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
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) {
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();
Expand Down

0 comments on commit 5c3c188

Please sign in to comment.