Fixed "RESET is not a style/color" error.

This commit is contained in:
Stefan923 2020-05-10 17:18:48 +03:00 committed by BrowkS
parent c42949ec59
commit 4d05b4a376
1 changed files with 8 additions and 4 deletions

View File

@ -65,11 +65,15 @@ public class TextUtil {
text = ""; text = "";
} }
ChatColor tempColor = ChatColor.getByChar(chars[i + 1]); ChatColor tempColor = ChatColor.getByChar(chars[i + 1]);
if (tempColor.isColor()) { if (tempColor != null) {
if (tempColor == ChatColor.RESET) {
color = ChatColor.WHITE;
} else if (tempColor.isColor()) {
color = tempColor; color = tempColor;
} else { } else {
style = tempColor; style = tempColor;
} }
}
i++; // skip color char i++; // skip color char
} else { } else {
text += chars[i]; text += chars[i];