Package net.minecraft.text
Interface StringVisitable
- All Known Subinterfaces:
MutableText
,Text
- All Known Implementing Classes:
BaseText
,KeybindText
,LiteralText
,NbtText
,NbtText.BlockNbtText
,NbtText.EntityNbtText
,NbtText.StorageNbtText
,ScoreText
,SelectorText
,TextHandler.StyledString
,TranslatableText
public interface StringVisitable
An object that can supply strings to a visitor,
with or without a style context.
- Mappings:
Namespace Name official ol
intermediary net/minecraft/class_5348
named net/minecraft/text/StringVisitable
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
StringVisitable.StyledVisitor<T>
A visitor for string content and a contextualStyle
.static interface
StringVisitable.Visitor<T>
A visitor for string content. -
Field Summary
Fields Modifier and Type Field Description static StringVisitable
EMPTY
An empty visitable that does not call the visitors.static Optional<Unit>
TERMINATE_VISIT
Convenience object indicating the termination of a string visit. -
Method Summary
Modifier and Type Method Description static StringVisitable
concat(List<StringVisitable> visitables)
Concats multiple string visitables by the order they appear in the list.static StringVisitable
concat(StringVisitable[] visitables)
Concats multiple string visitables by the order they appear in the array.default String
getString()
static StringVisitable
plain(String string)
Creates a visitable from a plain string.static StringVisitable
styled(String string, Style style)
Creates a visitable from a plain string and a root style.<T> Optional<T>
visit(StringVisitable.StyledVisitor<T> styledVisitor, Style style)
Supplies this visitable's literal content and contextual style to the visitor.<T> Optional<T>
visit(StringVisitable.Visitor<T> visitor)
Supplies this visitable's literal content to the visitor.
-
Field Details
-
TERMINATE_VISIT
Convenience object indicating the termination of a string visit.- Mappings:
Namespace Name Mixin selector official b
Lol;b:Ljava/util/Optional;
intermediary field_25309
Lnet/minecraft/class_5348;field_25309:Ljava/util/Optional;
named TERMINATE_VISIT
Lnet/minecraft/text/StringVisitable;TERMINATE_VISIT:Ljava/util/Optional;
-
EMPTY
An empty visitable that does not call the visitors.- Mappings:
Namespace Name Mixin selector official c
Lol;c:Lol;
intermediary field_25310
Lnet/minecraft/class_5348;field_25310:Lnet/minecraft/class_5348;
named EMPTY
Lnet/minecraft/text/StringVisitable;EMPTY:Lnet/minecraft/text/StringVisitable;
-
-
Method Details
-
visit
Supplies this visitable's literal content to the visitor.- Parameters:
visitor
- the visitor- Returns:
Optional.empty()
if the visit finished, or a terminating result from thevisitor
- Mappings:
Namespace Name Mixin selector official a
Lol;a(Lol$a;)Ljava/util/Optional;
intermediary method_27657
Lnet/minecraft/class_5348;method_27657(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;
named visit
Lnet/minecraft/text/StringVisitable;visit(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
-
visit
@Environment(CLIENT) <T> Optional<T> visit(StringVisitable.StyledVisitor<T> styledVisitor, Style style)Supplies this visitable's literal content and contextual style to the visitor.- 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 a
Lol;a(Lol$b;Los;)Ljava/util/Optional;
intermediary method_27658
Lnet/minecraft/class_5348;method_27658(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;
named visit
Lnet/minecraft/text/StringVisitable;visit(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
-
plain
Creates a visitable from a plain string.- Parameters:
string
- the plain string- Mappings:
Namespace Name Mixin selector official b
Lol;b(Ljava/lang/String;)Lol;
intermediary method_29430
Lnet/minecraft/class_5348;method_29430(Ljava/lang/String;)Lnet/minecraft/class_5348;
named plain
Lnet/minecraft/text/StringVisitable;plain(Ljava/lang/String;)Lnet/minecraft/text/StringVisitable;
-
styled
Creates a visitable from a plain string and a root style.- Parameters:
string
- the plain stringstyle
- the root style- Mappings:
Namespace Name Mixin selector official a
Lol;a(Ljava/lang/String;Los;)Lol;
intermediary method_29431
Lnet/minecraft/class_5348;method_29431(Ljava/lang/String;Lnet/minecraft/class_2583;)Lnet/minecraft/class_5348;
named styled
Lnet/minecraft/text/StringVisitable;styled(Ljava/lang/String;Lnet/minecraft/text/Style;)Lnet/minecraft/text/StringVisitable;
-
concat
Concats multiple string visitables by the order they appear in the array.- Parameters:
visitables
- an array or varargs of visitables- Mappings:
Namespace Name Mixin selector official a
Lol;a([Lol;)Lol;
intermediary method_29433
Lnet/minecraft/class_5348;method_29433([Lnet/minecraft/class_5348;)Lnet/minecraft/class_5348;
named concat
Lnet/minecraft/text/StringVisitable;concat([Lnet/minecraft/text/StringVisitable;)Lnet/minecraft/text/StringVisitable;
-
concat
Concats multiple string visitables by the order they appear in the list.- Parameters:
visitables
- a list of visitables- Mappings:
Namespace Name Mixin selector official a
Lol;a(Ljava/util/List;)Lol;
intermediary method_29432
Lnet/minecraft/class_5348;method_29432(Ljava/util/List;)Lnet/minecraft/class_5348;
named concat
Lnet/minecraft/text/StringVisitable;concat(Ljava/util/List;)Lnet/minecraft/text/StringVisitable;
-
getString
- Mappings:
Namespace Name Mixin selector official getString
Lol;getString()Ljava/lang/String;
intermediary getString
Lnet/minecraft/class_5348;getString()Ljava/lang/String;
named getString
Lnet/minecraft/text/StringVisitable;getString()Ljava/lang/String;
-