Skip to content

Commit

Permalink
fix klmno format codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 11, 2019
1 parent 3b993a8 commit 662811f
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -120,8 +120,6 @@ public static BaseComponent[] parse(String str) {
char[] chars = str.toCharArray();
List<BaseComponent> outputList = new ArrayList<>();
int started = 0;
//TextComponent lastText = new TextComponent();
//outputList.add(lastText);
TextComponent nextText = new TextComponent();
for (int i = 0; i < chars.length; i++) {
if (chars[i] == ChatColor.COLOR_CHAR && i + 1 < chars.length) {
Expand Down Expand Up @@ -245,11 +243,13 @@ else if (innardType.equals("insertion")) {
else if ((code >= '0' && code <= '9') || (code >= 'a' && code <= 'f') || (code >= 'A' && code <= 'F')) {
nextText.setText(nextText.getText() + str.substring(started, i));
outputList.add(nextText);
//lastText = nextText;
nextText = new TextComponent();
nextText.setColor(ChatColor.getByChar(code));
}
else if ((code >= 'k' && code <= 'o') || (code >= 'K' && code <= 'O')) {
nextText.setText(nextText.getText() + str.substring(started, i));
outputList.add(nextText);
nextText = new TextComponent();
if (code == 'k' || code == 'K') {
nextText.setObfuscated(true);
}
Expand All @@ -269,7 +269,6 @@ else if (code == 'o' || code == 'O') {
else if (code == 'r' || code == 'R') {
nextText.setText(nextText.getText() + str.substring(started, i));
outputList.add(nextText);
//lastText = nextText;
nextText = new TextComponent();
}
else {
Expand Down

0 comments on commit 662811f

Please sign in to comment.