Skip to content

Commit

Permalink
fix text parser issues with extremely long convoluted text
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 16, 2022
1 parent f95e83a commit c082f58
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -506,7 +506,7 @@ else if (innardType.equals("translate")) {
lastText.addExtra(component);
}
else if (innardType.equals("click") && innardParts.size() == 1) {
int endIndex = findEndIndexFor(str, "click", i + 5);
int endIndex = findEndIndexFor(str, "click", endBracket);
if (endIndex == -1) {
continue;
}
Expand All @@ -519,7 +519,7 @@ else if (innardType.equals("click") && innardParts.size() == 1) {
endBracket = endIndex + "&[/click".length();
}
else if (innardType.equals("hover")) {
int endIndex = findEndIndexFor(str, "hover", i + 5);
int endIndex = findEndIndexFor(str, "hover", endBracket);
if (endIndex == -1) {
continue;
}
Expand Down Expand Up @@ -590,7 +590,7 @@ else if (CoreConfiguration.debugVerbose) {
Debug.echoError("Text parse issue: cannot interpret color '" + innardBase.get(1) + "'.");
}
if (color != null) {
int endIndex = findEndIndexFor(str, "[color=", "[reset=color]", i + 1);
int endIndex = findEndIndexFor(str, "[color=", "[reset=color]", endBracket);
if (endIndex == -1) {
nextText.setColor(color);
}
Expand Down Expand Up @@ -628,7 +628,7 @@ else if (innardType.equals("gradient") && innardParts.size() == 2) {
}
}
else if (innardType.equals("font")) {
int endIndex = findEndIndexFor(str, "[font=", "[reset=font]", i + 1);
int endIndex = findEndIndexFor(str, "[font=", "[reset=font]", endBracket);
if (endIndex == -1) {
nextText.setFont(innardBase.get(1));
}
Expand Down

0 comments on commit c082f58

Please sign in to comment.