Skip to content

Commit

Permalink
fix(text-minimessage): Pass through style on virtual components
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Feb 16, 2024
1 parent 336905a commit fa0fdce
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
* @since 4.10.0
*/
abstract class AbstractColorChangingTag implements Modifying, Examinable {

private static final ComponentFlattener LENGTH_CALCULATOR = ComponentFlattener.builder()
.mapper(TextComponent.class, TextComponent::content)
.unknownMapper(x -> "_") // every unknown component gets a single colour
Expand Down Expand Up @@ -104,7 +103,7 @@ public final void postVisit() {
public final Component apply(final @NotNull Component current, final int depth) {
if (depth == 0) {
// capture state into a virtual component, no other logic is needed in normal MM handling
return Component.virtual(Void.class, new TagInfoHolder(this.preserveData(), current));
return Component.virtual(Void.class, new TagInfoHolder(this.preserveData(), current), current.style());
}

if ((this.disableApplyingColorDepth != -1 && depth > this.disableApplyingColorDepth) || current.style().color() != null) {
Expand Down

0 comments on commit fa0fdce

Please sign in to comment.