Package net.minecraft.text
Interface TextContent
- All Known Subinterfaces:
class_8828
- All Known Implementing Classes:
class_8828.LiteralTextContent,KeybindTextContent,NbtTextContent,ScoreTextContent,SelectorTextContent,TranslatableTextContent
public interface TextContent
Represents type-specific content of text. It is stored in each tree node
in a text tree structure. Its implementations are immutable.
- Mappings:
Namespace Name official tmintermediary net/minecraft/class_7417named net/minecraft/text/TextContent
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordTextContent.class_8823<T extends TextContent> -
Method Summary
Modifier and TypeMethodDescriptiondefault MutableTextparse(@Nullable ServerCommandSource source, @Nullable Entity sender, int depth) Parses this content into a basic mutable text without custom style or siblings.default <T> Optional<T>visit(StringVisitable.StyledVisitor<T> visitor, Style style) Visits this content.default <T> Optional<T>visit(StringVisitable.Visitor<T> visitor) Visits this content.
-
Method Details
-
visit
Visits this content. Returns a value if the visitor terminates amid the visit, orOptional.empty()if it proceeds.- Returns:
Optional.empty()if the visit finished, or a terminating result from thevisitor- See Also:
- Mappings:
Namespace Name Mixin selector official aLtm;a(Ltq$b;Lui;)Ljava/util/Optional;intermediary method_27660Lnet/minecraft/class_7417;method_27660(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;named visitLnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
-
visit
Visits this content. Returns a value if the visitor terminates amid the visit, orOptional.empty()if it proceeds.- Returns:
Optional.empty()if the visit finished, or a terminating result from thevisitor- See Also:
- Mappings:
Namespace Name Mixin selector official aLtm;a(Ltq$a;)Ljava/util/Optional;intermediary method_27659Lnet/minecraft/class_7417;method_27659(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;named visitLnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
-
parse
default MutableText parse(@Nullable @Nullable ServerCommandSource source, @Nullable @Nullable Entity sender, int depth) throws com.mojang.brigadier.exceptions.CommandSyntaxException Parses this content into a basic mutable text without custom style or siblings. The resulting text may or may not have this content.- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official aLtm;a(Ldt;Lbiw;I)Ltz;intermediary method_10890Lnet/minecraft/class_7417;method_10890(Lnet/minecraft/class_2168;Lnet/minecraft/class_1297;I)Lnet/minecraft/class_5250;named parseLnet/minecraft/text/TextContent;parse(Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/entity/Entity;I)Lnet/minecraft/text/MutableText;
-
method_54163
TextContent.class_8823<?> method_54163()- Mappings:
Namespace Name Mixin selector official aLtm;a()Ltm$a;intermediary method_54163Lnet/minecraft/class_7417;method_54163()Lnet/minecraft/class_7417$class_8823;named method_54163Lnet/minecraft/text/TextContent;method_54163()Lnet/minecraft/text/TextContent$class_8823;
-