Skip to content

Commit

Permalink
Catch the crash with negative size structures
Browse files Browse the repository at this point in the history
I never could reproduce this crash, just the invalid structures. Probably was orientation dependant. Easy to catch though
  • Loading branch information
KnightMiner committed Jun 15, 2021
1 parent 1c91ea6 commit c68a831
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public static void renderFluids(MatrixStack matrices, IRenderTypeBuffer buffer,
// determine x and z bounds, constant
int xd = tankMaxPos.getX() - tankMinPos.getX();
int zd = tankMaxPos.getZ() - tankMinPos.getZ();
// somehow people are getting a rendering crash with these being negative, no idea how but easy to catch
if (xd < 0 || zd < 0) {
return;
}
float[] xBounds = getBlockBounds(xd);
float[] zBounds = getBlockBounds(zd);

Expand Down

0 comments on commit c68a831

Please sign in to comment.