mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Correctly handle invalid dye colors, fixes #9
This commit is contained in:
parent
6ced514a1d
commit
d3317fc755
@ -4986,9 +4986,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
public static DyeColor getDyeColor(String s) {
|
||||
|
||||
String col = Lang.getKey(s);
|
||||
String col = Lang.getKey(MiscUtil.getCapitalized(s));
|
||||
col = col.replace("COLOR_", "");
|
||||
DyeColor color = DyeColor.valueOf(col);
|
||||
DyeColor color = null;
|
||||
try {
|
||||
color = DyeColor.valueOf(col);
|
||||
} catch (IllegalArgumentException e) {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
return color != null ? color : getDyeColorLegacy(s);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user