Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddafd28

Browse files
author
AMinecraftDev
committed
Fixed issue with NumberUtil#getPercent
1 parent 5e44a08 commit ddafd28

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.stellardev.galactic</groupId>
88
<artifactId>GalacticLib</artifactId>
9-
<version>1.11.3</version>
9+
<version>1.11.4</version>
1010
<packaging>jar</packaging>
1111

1212
<build>

src/org/stellardev/galacticlib/util/NumberUtil.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public String formatToSuffix(long amount) {
5454
return SINGLE_DECIMAL.format(((double) amount / (double) divideBy)) + suffix;
5555
}
5656

57+
public String getProgressBar(int current, int max, int totalBars, String symbol, ChatColor completeColor, ChatColor notCompleteColor) {
58+
return getProgressBar(current, (long) max, totalBars, symbol, completeColor, notCompleteColor);
59+
}
60+
5761
public String getProgressBar(long current, long max, int totalBars, String symbol, ChatColor completeColor, ChatColor notCompleteColor) {
5862
float percent = (float) current / max;
5963
int progressBars = (int) (totalBars * percent);
@@ -82,6 +86,10 @@ public int getPercent(long current, long max) {
8286
return (int) (current / onePercent);
8387
}
8488

89+
public int getPercent(int current, int max) {
90+
return getPercent(current, (long) max);
91+
}
92+
8593
public String shortenChance(double chance) {
8694
return CHANCE_FORMAT.format(chance);
8795
}

0 commit comments

Comments
 (0)