Skip to content

Commit

Permalink
Fix division by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfieboy09 committed Nov 12, 2024
1 parent 24e6050 commit 27ddabb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected void renderBg(@NotNull GuiGraphics graphics, float v, int i, int i1) {

int progress = this.menu.getCurrentProgress();
int recipeTotalProgress = this.menu.getTotalProgress();
int width = progress * 30 / recipeTotalProgress;
int width = recipeTotalProgress == 0 ? 0 : progress * 30 / recipeTotalProgress;
graphics.blit(BACKGROUND_LOCATION, this.leftPos + 52, this.topPos + 25, 176, 0, width, 34);
}

Expand Down

0 comments on commit 27ddabb

Please sign in to comment.