Package net.minecraft.text
Interface Text
- All Superinterfaces:
com.mojang.brigadier.Message,StringVisitable
- All Known Implementing Classes:
MutableText
A text. Can be converted to and from JSON format.
Each text has a tree structure, embodying all its siblings. To iterate contents in the text and all
its siblings, call visit methods.
This interface does not expose mutation operations. For mutation,
refer to MutableText.
- See Also:
- Mappings:
Namespace Name official qyintermediary net/minecraft/class_2561named net/minecraft/text/Text
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.text.StringVisitable
StringVisitable.StyledVisitor<T>, StringVisitable.Visitor<T> -
Field Summary
Fields inherited from interface net.minecraft.text.StringVisitable
EMPTY, TERMINATE_VISIT -
Method Summary
Modifier and TypeMethodDescriptionasString()Returns the string representation of this text itself, excluding siblings.default StringasTruncatedString(int length) Returns the full string representation of this text, truncated beyond the suppliedlength.default MutableTextcopy()Copies the text itself, excluding the styles or siblings.Returns the siblings of this text.default StringgetStyle()Returns the style of this text.getWithStyle(Style style) static MutableTextmethod_43466(String string, String string2) static MutableTextmethod_43467(String string, Optional<Text> optional) static MutableTextmethod_43468(String string, boolean bool, Optional<Text> optional, class_7419 class_7419) static MutableTextmethod_43469(String string, Object[] object) static MutableTextmethod_43470(String string) static MutableTextmethod_43471(String string) static MutableTextmethod_43472(String string) static MutableTextstatic TextCreates a literal text with the given string as content.default MutableTextCopies the text itself, the style, and the siblings.default <T> Optional<T>visit(StringVisitable.StyledVisitor<T> styledVisitor, Style style) Supplies this visitable's literal content and contextual style to the visitor.default <T> Optional<T>visit(StringVisitable.Visitor<T> visitor) Supplies this visitable's literal content to the visitor.
-
Method Details
-
getStyle
Style getStyle()Returns the style of this text.- Mappings:
Namespace Name Mixin selector official aLqy;a()Lre;intermediary method_10866Lnet/minecraft/class_2561;method_10866()Lnet/minecraft/class_2583;named getStyleLnet/minecraft/text/Text;getStyle()Lnet/minecraft/text/Style;
-
asString
class_7417 asString()Returns the string representation of this text itself, excluding siblings.- Mappings:
Namespace Name Mixin selector official bLqy;b()Lqz;intermediary method_10851Lnet/minecraft/class_2561;method_10851()Lnet/minecraft/class_7417;named asStringLnet/minecraft/text/Text;asString()Lnet/minecraft/class_7417;
-
getString
- Specified by:
getStringin interfacecom.mojang.brigadier.Message- Specified by:
getStringin interfaceStringVisitable
-
asTruncatedString
Returns the full string representation of this text, truncated beyond the suppliedlength.- Parameters:
length- the max length allowed for the string representation of the text- Mappings:
Namespace Name Mixin selector official aLqy;a(I)Ljava/lang/String;intermediary method_10858Lnet/minecraft/class_2561;method_10858(I)Ljava/lang/String;named asTruncatedStringLnet/minecraft/text/Text;asTruncatedString(I)Ljava/lang/String;
-
getSiblings
Returns the siblings of this text.- Mappings:
Namespace Name Mixin selector official cLqy;c()Ljava/util/List;intermediary method_10855Lnet/minecraft/class_2561;method_10855()Ljava/util/List;named getSiblingsLnet/minecraft/text/Text;getSiblings()Ljava/util/List;
-
copy
Copies the text itself, excluding the styles or siblings.- Mappings:
Namespace Name Mixin selector official dLqy;d()Lrd;intermediary method_27662Lnet/minecraft/class_2561;method_27662()Lnet/minecraft/class_5250;named copyLnet/minecraft/text/Text;copy()Lnet/minecraft/text/MutableText;
-
shallowCopy
Copies the text itself, the style, and the siblings.A shallow copy is made for the siblings.
- Mappings:
Namespace Name Mixin selector official eLqy;e()Lrd;intermediary method_27661Lnet/minecraft/class_2561;method_27661()Lnet/minecraft/class_5250;named shallowCopyLnet/minecraft/text/Text;shallowCopy()Lnet/minecraft/text/MutableText;
-
asOrderedText
OrderedText asOrderedText()- Mappings:
Namespace Name Mixin selector official fLqy;f()Lajy;intermediary method_30937Lnet/minecraft/class_2561;method_30937()Lnet/minecraft/class_5481;named asOrderedTextLnet/minecraft/text/Text;asOrderedText()Lnet/minecraft/text/OrderedText;
-
visit
Supplies this visitable's literal content and contextual style to the visitor.- Specified by:
visitin interfaceStringVisitable- Parameters:
styledVisitor- the visitorstyle- the contextual style- Returns:
Optional.empty()if the visit finished, or a terminating result from thevisitor- Mappings:
Namespace Name Mixin selector official aLrb;a(Lrb$b;Lre;)Ljava/util/Optional;intermediary method_27658Lnet/minecraft/class_5348;method_27658(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;named visitLnet/minecraft/text/StringVisitable;visit(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
-
visit
Supplies this visitable's literal content to the visitor.- Specified by:
visitin interfaceStringVisitable- Parameters:
visitor- the visitor- Returns:
Optional.empty()if the visit finished, or a terminating result from thevisitor- Mappings:
Namespace Name Mixin selector official aLrb;a(Lrb$a;)Ljava/util/Optional;intermediary method_27657Lnet/minecraft/class_5348;method_27657(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;named visitLnet/minecraft/text/StringVisitable;visit(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
-
getWithStyle
- Mappings:
Namespace Name Mixin selector official aLqy;a(Lre;)Ljava/util/List;intermediary method_36136Lnet/minecraft/class_2561;method_36136(Lnet/minecraft/class_2583;)Ljava/util/List;named getWithStyleLnet/minecraft/text/Text;getWithStyle(Lnet/minecraft/text/Style;)Ljava/util/List;
-
of
Creates a literal text with the given string as content.- Mappings:
Namespace Name Mixin selector official aLqy;a(Ljava/lang/String;)Lqy;intermediary method_30163Lnet/minecraft/class_2561;method_30163(Ljava/lang/String;)Lnet/minecraft/class_2561;named ofLnet/minecraft/text/Text;of(Ljava/lang/String;)Lnet/minecraft/text/Text;
-
method_43470
- Mappings:
Namespace Name Mixin selector official bLqy;b(Ljava/lang/String;)Lrd;intermediary method_43470Lnet/minecraft/class_2561;method_43470(Ljava/lang/String;)Lnet/minecraft/class_5250;named method_43470Lnet/minecraft/text/Text;method_43470(Ljava/lang/String;)Lnet/minecraft/text/MutableText;
-
method_43471
- Mappings:
Namespace Name Mixin selector official cLqy;c(Ljava/lang/String;)Lrd;intermediary method_43471Lnet/minecraft/class_2561;method_43471(Ljava/lang/String;)Lnet/minecraft/class_5250;named method_43471Lnet/minecraft/text/Text;method_43471(Ljava/lang/String;)Lnet/minecraft/text/MutableText;
-
method_43469
- Mappings:
Namespace Name Mixin selector official aLqy;a(Ljava/lang/String;[Ljava/lang/Object;)Lrd;intermediary method_43469Lnet/minecraft/class_2561;method_43469(Ljava/lang/String;[Ljava/lang/Object;)Lnet/minecraft/class_5250;named method_43469Lnet/minecraft/text/Text;method_43469(Ljava/lang/String;[Ljava/lang/Object;)Lnet/minecraft/text/MutableText;
-
method_43473
- Mappings:
Namespace Name Mixin selector official gLqy;g()Lrd;intermediary method_43473Lnet/minecraft/class_2561;method_43473()Lnet/minecraft/class_5250;named method_43473Lnet/minecraft/text/Text;method_43473()Lnet/minecraft/text/MutableText;
-
method_43472
- Mappings:
Namespace Name Mixin selector official dLqy;d(Ljava/lang/String;)Lrd;intermediary method_43472Lnet/minecraft/class_2561;method_43472(Ljava/lang/String;)Lnet/minecraft/class_5250;named method_43472Lnet/minecraft/text/Text;method_43472(Ljava/lang/String;)Lnet/minecraft/text/MutableText;
-
method_43468
static MutableText method_43468(String string, boolean bool, Optional<Text> optional, class_7419 class_7419) - Mappings:
Namespace Name Mixin selector official aLqy;a(Ljava/lang/String;ZLjava/util/Optional;Lri;)Lrd;intermediary method_43468Lnet/minecraft/class_2561;method_43468(Ljava/lang/String;ZLjava/util/Optional;Lnet/minecraft/class_7419;)Lnet/minecraft/class_5250;named method_43468Lnet/minecraft/text/Text;method_43468(Ljava/lang/String;ZLjava/util/Optional;Lnet/minecraft/class_7419;)Lnet/minecraft/text/MutableText;
-
method_43466
- Mappings:
Namespace Name Mixin selector official aLqy;a(Ljava/lang/String;Ljava/lang/String;)Lrd;intermediary method_43466Lnet/minecraft/class_2561;method_43466(Ljava/lang/String;Ljava/lang/String;)Lnet/minecraft/class_5250;named method_43466Lnet/minecraft/text/Text;method_43466(Ljava/lang/String;Ljava/lang/String;)Lnet/minecraft/text/MutableText;
-
method_43467
- Mappings:
Namespace Name Mixin selector official aLqy;a(Ljava/lang/String;Ljava/util/Optional;)Lrd;intermediary method_43467Lnet/minecraft/class_2561;method_43467(Ljava/lang/String;Ljava/util/Optional;)Lnet/minecraft/class_5250;named method_43467Lnet/minecraft/text/Text;method_43467(Ljava/lang/String;Ljava/util/Optional;)Lnet/minecraft/text/MutableText;
-