Class MutableText

java.lang.Object
net.minecraft.text.MutableText
All Implemented Interfaces:
com.mojang.brigadier.Message, StringVisitable, Text

public class MutableText extends Object implements Text
The text implementation, with mutation operations.
Mappings:
Namespace Name
named net/minecraft/text/MutableText
intermediary net/minecraft/class_5250
official yd
  • Field Details

    • content

      private final TextContent content
      Mappings:
      Namespace Name Mixin selector
      named content Lnet/minecraft/text/MutableText;content:Lnet/minecraft/text/TextContent;
      intermediary field_39005 Lnet/minecraft/class_5250;field_39005:Lnet/minecraft/class_7417;
      official c Lyd;c:Lxq;
    • siblings

      private final List<Text> siblings
      Mappings:
      Namespace Name Mixin selector
      named siblings Lnet/minecraft/text/MutableText;siblings:Ljava/util/List;
      intermediary field_39006 Lnet/minecraft/class_5250;field_39006:Ljava/util/List;
      official d Lyd;d:Ljava/util/List;
    • style

      private Style style
      Mappings:
      Namespace Name Mixin selector
      named style Lnet/minecraft/text/MutableText;style:Lnet/minecraft/text/Style;
      intermediary field_39007 Lnet/minecraft/class_5250;field_39007:Lnet/minecraft/class_2583;
      official e Lyd;e:Lym;
    • ordered

      private OrderedText ordered
      Mappings:
      Namespace Name Mixin selector
      named ordered Lnet/minecraft/text/MutableText;ordered:Lnet/minecraft/text/OrderedText;
      intermediary field_39008 Lnet/minecraft/class_5250;field_39008:Lnet/minecraft/class_5481;
      official f Lyd;f:Layl;
    • language

      @Nullable private @Nullable Language language
      Mappings:
      Namespace Name Mixin selector
      named language Lnet/minecraft/text/MutableText;language:Lnet/minecraft/util/Language;
      intermediary field_39009 Lnet/minecraft/class_5250;field_39009:Lnet/minecraft/class_2477;
      official g Lyd;g:Lun;
  • Constructor Details

    • MutableText

      MutableText(TextContent content, List<Text> siblings, Style style)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/text/MutableText;<init>(Lnet/minecraft/text/TextContent;Ljava/util/List;Lnet/minecraft/text/Style;)V
      intermediary <init> Lnet/minecraft/class_5250;<init>(Lnet/minecraft/class_7417;Ljava/util/List;Lnet/minecraft/class_2583;)V
      official <init> Lyd;<init>(Lxq;Ljava/util/List;Lym;)V
  • Method Details

    • of

      public static MutableText of(TextContent content)
      Creates a piece of mutable text with the given content, with no sibling and style.
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/text/MutableText;of(Lnet/minecraft/text/TextContent;)Lnet/minecraft/text/MutableText;
      intermediary method_43477 Lnet/minecraft/class_5250;method_43477(Lnet/minecraft/class_7417;)Lnet/minecraft/class_5250;
      official a Lyd;a(Lxq;)Lyd;
    • getContent

      public TextContent getContent()
      Returns the content of the text.
      Specified by:
      getContent in interface Text
      Returns:
      the content of the text
      Mappings:
      Namespace Name Mixin selector
      named getContent Lnet/minecraft/text/Text;getContent()Lnet/minecraft/text/TextContent;
      intermediary method_10851 Lnet/minecraft/class_2561;method_10851()Lnet/minecraft/class_7417;
      official b Lxp;b()Lxq;
    • getSiblings

      public List<Text> getSiblings()
      Returns the siblings of this text.
      Specified by:
      getSiblings in interface Text
      Mappings:
      Namespace Name Mixin selector
      named getSiblings Lnet/minecraft/text/Text;getSiblings()Ljava/util/List;
      intermediary method_10855 Lnet/minecraft/class_2561;method_10855()Ljava/util/List;
      official c Lxp;c()Ljava/util/List;
    • setStyle

      public MutableText setStyle(Style style)
      Sets the style of this text.
      Mappings:
      Namespace Name Mixin selector
      named setStyle Lnet/minecraft/text/MutableText;setStyle(Lnet/minecraft/text/Style;)Lnet/minecraft/text/MutableText;
      intermediary method_10862 Lnet/minecraft/class_5250;method_10862(Lnet/minecraft/class_2583;)Lnet/minecraft/class_5250;
      official b Lyd;b(Lym;)Lyd;
    • getStyle

      public Style getStyle()
      Returns the style of this text.
      Specified by:
      getStyle in interface Text
      Mappings:
      Namespace Name Mixin selector
      named getStyle Lnet/minecraft/text/Text;getStyle()Lnet/minecraft/text/Style;
      intermediary method_10866 Lnet/minecraft/class_2561;method_10866()Lnet/minecraft/class_2583;
      official a Lxp;a()Lym;
    • append

      public MutableText append(String text)
      Appends a literal text with content text to this text's siblings.
      Parameters:
      text - the literal text content
      Mappings:
      Namespace Name Mixin selector
      named append Lnet/minecraft/text/MutableText;append(Ljava/lang/String;)Lnet/minecraft/text/MutableText;
      intermediary method_27693 Lnet/minecraft/class_5250;method_27693(Ljava/lang/String;)Lnet/minecraft/class_5250;
      official f Lyd;f(Ljava/lang/String;)Lyd;
    • append

      public MutableText append(Text text)
      Appends a text to this text's siblings.
      Parameters:
      text - the sibling
      Mappings:
      Namespace Name Mixin selector
      named append Lnet/minecraft/text/MutableText;append(Lnet/minecraft/text/Text;)Lnet/minecraft/text/MutableText;
      intermediary method_10852 Lnet/minecraft/class_5250;method_10852(Lnet/minecraft/class_2561;)Lnet/minecraft/class_5250;
      official b Lyd;b(Lxp;)Lyd;
    • styled

      public MutableText styled(UnaryOperator<Style> styleUpdater)
      Updates the style of this text.
      Parameters:
      styleUpdater - the style updater
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named styled Lnet/minecraft/text/MutableText;styled(Ljava/util/function/UnaryOperator;)Lnet/minecraft/text/MutableText;
      intermediary method_27694 Lnet/minecraft/class_5250;method_27694(Ljava/util/function/UnaryOperator;)Lnet/minecraft/class_5250;
      official a Lyd;a(Ljava/util/function/UnaryOperator;)Lyd;
    • fillStyle

      public MutableText fillStyle(Style styleOverride)
      Fills the absent parts of this text's style with definitions from styleOverride.
      Parameters:
      styleOverride - the style that provides definitions for absent definitions in this text's style
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named fillStyle Lnet/minecraft/text/MutableText;fillStyle(Lnet/minecraft/text/Style;)Lnet/minecraft/text/MutableText;
      intermediary method_27696 Lnet/minecraft/class_5250;method_27696(Lnet/minecraft/class_2583;)Lnet/minecraft/class_5250;
      official c Lyd;c(Lym;)Lyd;
    • formatted

      public MutableText formatted(Formatting[] formattings)
      Adds some formattings to this text's style.
      Parameters:
      formattings - an array of formattings
      Mappings:
      Namespace Name Mixin selector
      named formatted Lnet/minecraft/text/MutableText;formatted([Lnet/minecraft/util/Formatting;)Lnet/minecraft/text/MutableText;
      intermediary method_27695 Lnet/minecraft/class_5250;method_27695([Lnet/minecraft/class_124;)Lnet/minecraft/class_5250;
      official a Lyd;a([Ln;)Lyd;
    • formatted

      public MutableText formatted(Formatting formatting)
      Add a formatting to this text's style.
      Parameters:
      formatting - a formatting
      Mappings:
      Namespace Name Mixin selector
      named formatted Lnet/minecraft/text/MutableText;formatted(Lnet/minecraft/util/Formatting;)Lnet/minecraft/text/MutableText;
      intermediary method_27692 Lnet/minecraft/class_5250;method_27692(Lnet/minecraft/class_124;)Lnet/minecraft/class_5250;
      official a Lyd;a(Ln;)Lyd;
    • withColor

      public MutableText withColor(int color)
      Returns the text with the RGB color color.
      Returns:
      the text with the RGB color color
      Mappings:
      Namespace Name Mixin selector
      named withColor Lnet/minecraft/text/MutableText;withColor(I)Lnet/minecraft/text/MutableText;
      intermediary method_54663 Lnet/minecraft/class_5250;method_54663(I)Lnet/minecraft/class_5250;
      official b Lyd;b(I)Lyd;
    • asOrderedText

      public OrderedText asOrderedText()
      Specified by:
      asOrderedText in interface Text
      Mappings:
      Namespace Name Mixin selector
      named asOrderedText Lnet/minecraft/text/Text;asOrderedText()Lnet/minecraft/text/OrderedText;
      intermediary method_30937 Lnet/minecraft/class_2561;method_30937()Lnet/minecraft/class_5481;
      official g Lxp;g()Layl;
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      named equals Lnet/minecraft/text/MutableText;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_5250;equals(Ljava/lang/Object;)Z
      official equals Lyd;equals(Ljava/lang/Object;)Z
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object