mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-23 00:05:52 +01:00
fix stat decimal format
This commit is contained in:
parent
389d386d25
commit
51ead6884b
@ -121,7 +121,7 @@ public enum StatType {
|
||||
FileConfiguration config = new ConfigFile("stats").getConfig();
|
||||
for (StatType stat : values()) {
|
||||
stat.defaultInfo = config.contains("default." + stat.name()) ? new LinearValue(config.getConfigurationSection("default." + stat.name())) : new LinearValue(0, 0);
|
||||
stat.format = new DecimalFormat(config.contains("decimal-format." + stat.name()) ? config.getString("decimal-format." + stat.name()) : "0.#");
|
||||
stat.format = MMOCore.plugin.configManager.newFormat(config.contains("decimal-format." + stat.name()) ? config.getString("decimal-format." + stat.name()) : "0.#");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,6 +115,10 @@ public class ConfigManager {
|
||||
}
|
||||
}
|
||||
|
||||
public DecimalFormat newFormat(String pattern) {
|
||||
return new DecimalFormat(pattern, formatSymbols);
|
||||
}
|
||||
|
||||
private char getFirstChar(String str, char defaultChar) {
|
||||
return str == null || str.isEmpty() ? defaultChar : str.charAt(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user