mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-23 00:05:52 +01:00
Fixed onEnable() error with ChatColor lookup
This commit is contained in:
parent
ae24ffccb6
commit
2a6417ad10
@ -103,8 +103,8 @@ public class ConfigManager {
|
||||
manaFull = getColorOrDefault("mana-whole", ChatColor.BLUE);
|
||||
manaHalf = getColorOrDefault("mana-half", ChatColor.AQUA);
|
||||
manaEmpty = getColorOrDefault("mana-empty", ChatColor.WHITE);
|
||||
staminaFull = getColorOrDefault("stamina-whole", ChatColor.BLUE);
|
||||
staminaHalf = getColorOrDefault("stamina-half", ChatColor.AQUA);
|
||||
staminaFull = getColorOrDefault("stamina-whole", ChatColor.GREEN);
|
||||
staminaHalf = getColorOrDefault("stamina-half", ChatColor.DARK_GREEN);
|
||||
staminaEmpty = getColorOrDefault("stamina-empty", ChatColor.WHITE);
|
||||
|
||||
neededExp.clear();
|
||||
@ -124,13 +124,16 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
private ChatColor getColorOrDefault(String configKey, ChatColor defaultColor) {
|
||||
ChatColor newColor = ChatColor.valueOf(MMOCore.plugin.getConfig().getString("resource-bar-colors." + configKey).toUpperCase());
|
||||
|
||||
if(newColor != null)
|
||||
return newColor;
|
||||
|
||||
MMOCore.log(Level.WARNING, "Resource Bar color config '" + configKey + "' is invalid... Using default color!");
|
||||
return defaultColor;
|
||||
ChatColor newColor;
|
||||
try {
|
||||
newColor = ChatColor.valueOf(MMOCore.plugin.getConfig().getString("resource-bar-colors." + configKey).toUpperCase());
|
||||
}
|
||||
catch(Exception e) {
|
||||
MMOCore.log(Level.WARNING, "Resource Bar color config '" + configKey + "' is invalid... Using default color.");
|
||||
newColor = defaultColor;
|
||||
}
|
||||
|
||||
return newColor;
|
||||
}
|
||||
|
||||
public DecimalFormat newFormat(String pattern) {
|
||||
|
Loading…
Reference in New Issue
Block a user