Skip to content

Commit

Permalink
Fixed Java Heap Space issue when getProgressBar division zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigerpanzer02 committed Jan 15, 2024
1 parent b0308bb commit 2a3958d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 1.3.7 Release
* Moved FoodLose/HungerLose to core
* Fixed LanguageMigrator file version fetching
* Fixed Java Heap Space issue when getProgressBar division zero

### 1.3.6 Release (13.01.2024)
* Fixed IAE Cannot measure distance between worlds if players are in different worlds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public static String formatIntoMMSS(int secsIn) {
* @return String with requested progress
*/
public static String getProgressBar(int current, int max, int totalBars, String symbol, String completedCharacter, String notCompletedCharacter) {
if(max == 0) {
max = current;
}
float percent = (float) current / max;
int progressBars = (int) (totalBars * percent);
int leftOver = (totalBars - progressBars);
Expand Down

0 comments on commit 2a3958d

Please sign in to comment.