Skip to content

Commit

Permalink
Fix wrong color/formatting inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoenix616 committed Nov 12, 2020
1 parent 111a533 commit befd7bb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main/java/de/themoep/minedown/adventure/MineDownParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,7 @@ private void append(ComponentBuilder builder) {
}

private void appendValue() {
appendValue(Style.empty());
}

private void appendValue(Style style) {
if (builder == null) {
builder = Component.text(value.toString()).toBuilder();
} else {
builder.append(Component.text(value.toString())).style(style);
}
ComponentBuilder builder = Component.text(value.toString()).toBuilder();
if (font != null) {
builder.font(Key.key(font));
}
Expand All @@ -328,6 +320,11 @@ private void appendValue(Style style) {
if (hoverEvent != null) {
builder.hoverEvent(hoverEvent);
}
if (this.builder == null) {
this.builder = Component.text().append(builder);
} else {
this.builder.append(builder);
}
value = new StringBuilder();
}

Expand Down

0 comments on commit befd7bb

Please sign in to comment.