/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.google.common.collect.Lists * org.jspecify.annotations.Nullable */ package net.minecraft.network.chat; import com.google.common.collect.Lists; import java.util.List; import java.util.function.UnaryOperator; import net.minecraft.ChatFormatting; import net.minecraft.locale.Language; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.ComponentContents; import net.minecraft.network.chat.Style; import net.minecraft.util.FormattedCharSequence; import org.jspecify.annotations.Nullable; public final class MutableComponent implements Component { private final ComponentContents contents; private final List siblings; private Style style; private FormattedCharSequence visualOrderText = FormattedCharSequence.EMPTY; private @Nullable Language decomposedWith; MutableComponent(ComponentContents contents, List siblings, Style style) { this.contents = contents; this.siblings = siblings; this.style = style; } public static MutableComponent create(ComponentContents contents) { return new MutableComponent(contents, Lists.newArrayList(), Style.EMPTY); } @Override public ComponentContents getContents() { return this.contents; } @Override public List getSiblings() { return this.siblings; } public MutableComponent setStyle(Style style) { this.style = style; return this; } @Override public Style getStyle() { return this.style; } public MutableComponent append(String text) { if (text.isEmpty()) { return this; } return this.append(Component.literal(text)); } public MutableComponent append(Component component) { this.siblings.add(component); return this; } public MutableComponent withStyle(UnaryOperator