mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-24 03:25:20 +01:00
Return pretty dye color name if translation non-existent, fixes #1195
This commit is contained in:
parent
5aaa0dc49d
commit
6e5ebdba93
@ -169,8 +169,23 @@ public class MiscUtil {
|
|||||||
* @return cleaned-up string
|
* @return cleaned-up string
|
||||||
*/
|
*/
|
||||||
public static String getPrettyDyeColorName(DyeColor color) {
|
public static String getPrettyDyeColorName(DyeColor color) {
|
||||||
|
if (!Lang.get("COLOR_" + color.name()).equals("NULL")) {
|
||||||
// Legacy
|
// Legacy
|
||||||
return Lang.get("COLOR_" + color.name());
|
return Lang.get("COLOR_" + color.name());
|
||||||
|
} else {
|
||||||
|
String baseString = color.toString();
|
||||||
|
String[] substrings = baseString.split("_");
|
||||||
|
String prettyString = "";
|
||||||
|
int size = 1;
|
||||||
|
for (String s : substrings) {
|
||||||
|
prettyString = prettyString.concat(getCapitalized(s));
|
||||||
|
if (size < substrings.length) {
|
||||||
|
prettyString = prettyString.concat(" ");
|
||||||
|
}
|
||||||
|
size++;
|
||||||
|
}
|
||||||
|
return prettyString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user