mirror of
https://github.com/itHotL/PlayerStats.git
synced 2025-01-04 18:57:53 +01:00
Added formatDefaultNumber to StatNumberFormatter for API
This commit is contained in:
parent
c4b963a057
commit
7a48e59049
6
pom.xml
6
pom.xml
@ -200,7 +200,7 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<phase>deploy</phase>
|
||||
<phase>deploy</phase> <!-- change to verify when deploying -->
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
@ -214,7 +214,7 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>deploy</phase>
|
||||
<phase>deploy</phase> <!-- change to verify when deploying -->
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
@ -228,7 +228,7 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<phase>deploy</phase>
|
||||
<phase>deploy</phase> <!-- change to verify when deploying -->
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
|
@ -4,6 +4,8 @@ import com.artemis.the.gr8.playerstats.api.enums.Unit;
|
||||
|
||||
public interface StatNumberFormatter {
|
||||
|
||||
String formatDefaultNumber(long number);
|
||||
|
||||
String formatDamageNumber(long number, Unit statUnit);
|
||||
|
||||
String formatDistanceNumber(long number, Unit statUnit);
|
||||
|
@ -564,7 +564,7 @@ public final class MessageBuilder implements StatTextFormatter {
|
||||
ArrayList<Unit> unitRange = getTimeUnitRange(statNumber);
|
||||
if (unitRange.size() <= 1 || (useHoverText && unitRange.size() <= 3)) {
|
||||
MyLogger.logWarning("There is something wrong with the time-units you specified, please check your config!");
|
||||
return componentFactory.timeNumber(formatter.formatNumber(statNumber), target);
|
||||
return componentFactory.timeNumber(formatter.formatDefaultNumber(statNumber), target);
|
||||
}
|
||||
else {
|
||||
String mainNumber = formatter.formatTimeNumber(statNumber, unitRange.get(0), unitRange.get(1));
|
||||
@ -586,7 +586,7 @@ public final class MessageBuilder implements StatTextFormatter {
|
||||
}
|
||||
|
||||
private TextComponent getDefaultNumberComponent(long statNumber, Target target) {
|
||||
return componentFactory.statNumber(formatter.formatNumber(statNumber), target);
|
||||
return componentFactory.statNumber(formatter.formatDefaultNumber(statNumber), target);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,8 @@ public final class NumberFormatter implements StatNumberFormatter {
|
||||
/**
|
||||
* Adds commas in groups of 3.
|
||||
*/
|
||||
public @NotNull String formatNumber(long number) {
|
||||
@Override
|
||||
public @NotNull String formatDefaultNumber(long number) {
|
||||
return format.format(number);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user