Skip to content

Commit

Permalink
Fix appending and color issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoenix616 committed Dec 23, 2020
1 parent 5074b7f commit 38d5360
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/java/de/themoep/minedown/adventure/MineDownParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ public ComponentBuilder parse(String message) throws IllegalArgumentException {
StringBuilder colorString = new StringBuilder();
for (int j = i; j < message.length(); j++) {
char c1 = message.charAt(j);
if (c1 == c && colorString.length() > 1) { String colorStr = colorString.toString();
if (c1 == c && colorString.length() > 1) {
String colorStr = colorString.toString();
rainbowPhase = parseRainbow(colorStr, "", lenient());
if (rainbowPhase == null && !colorStr.contains("=")) {
try {
Expand Down Expand Up @@ -230,6 +231,7 @@ public ComponentBuilder parse(String message) throws IllegalArgumentException {
appendValue();
}
colors(new ArrayList<>());
colors().add((TextColor) singleFormat);
if (formattingIsLegacy()) {
format(new HashSet<>());
}
Expand Down Expand Up @@ -399,12 +401,6 @@ private void appendValue() {
} else {
builder(builder);
}

if (builder() == null) {
builder(Component.text().append(builder));
} else {
builder().append(builder);
}
value(new StringBuilder());
}

Expand Down

0 comments on commit 38d5360

Please sign in to comment.