Package net.minecraft.text
Class TextVisitFactory
java.lang.Object
net.minecraft.text.TextVisitFactory
A utility class for visiting the characters of strings, handling surrogate
code points and formatting codes.
- Mappings:
Namespace Name named net/minecraft/text/TextVisitFactory
intermediary net/minecraft/class_5223
official baz
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final char
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
validateSurrogates
(String text) Returns a new string that has all surrogate characters within.static boolean
visitBackwards
(String text, Style style, CharacterVisitor visitor) Visits the code points of a string in backward (right to left) direction.static boolean
visitFormatted
(String text, int startIndex, Style style, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.static boolean
visitFormatted
(String text, int startIndex, Style startingStyle, Style resetStyle, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.static boolean
visitFormatted
(String text, Style style, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.static boolean
visitFormatted
(StringVisitable text, Style style, CharacterVisitor visitor) Visits the code points for every literal string and the formatting codes supplied by the renderable.static boolean
visitForwards
(String text, Style style, CharacterVisitor visitor) Visits the code points of a string in forward (left to right) direction.private static boolean
visitRegularCharacter
(Style style, CharacterVisitor visitor, int index, char c)
-
Field Details
-
REPLACEMENT_CHARACTER
private static final char REPLACEMENT_CHARACTER- See Also:
- Mappings:
Namespace Name Mixin selector named REPLACEMENT_CHARACTER
Lnet/minecraft/text/TextVisitFactory;REPLACEMENT_CHARACTER:C
intermediary field_29861
Lnet/minecraft/class_5223;field_29861:C
official a
Lbaz;a:C
-
VISIT_TERMINATED
- Mappings:
Namespace Name Mixin selector named VISIT_TERMINATED
Lnet/minecraft/text/TextVisitFactory;VISIT_TERMINATED:Ljava/util/Optional;
intermediary field_24215
Lnet/minecraft/class_5223;field_24215:Ljava/util/Optional;
official b
Lbaz;b:Ljava/util/Optional;
-
-
Constructor Details
-
TextVisitFactory
public TextVisitFactory()
-
-
Method Details
-
visitRegularCharacter
private static boolean visitRegularCharacter(Style style, CharacterVisitor visitor, int index, char c) - Mappings:
Namespace Name Mixin selector named visitRegularCharacter
Lnet/minecraft/text/TextVisitFactory;visitRegularCharacter(Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;IC)Z
intermediary method_27477
Lnet/minecraft/class_5223;method_27477(Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;IC)Z
official a
Lbaz;a(Lys;Lazr;IC)Z
-
visitForwards
Visits the code points of a string in forward (left to right) direction.- Parameters:
text
- the stringstyle
- the style of the stringvisitor
- the visitor of characters- Returns:
true
if the full string was visited, orfalse
indicating thevisitor
terminated half-way- Mappings:
Namespace Name Mixin selector named visitForwards
Lnet/minecraft/text/TextVisitFactory;visitForwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
intermediary method_27474
Lnet/minecraft/class_5223;method_27474(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z
official a
Lbaz;a(Ljava/lang/String;Lys;Lazr;)Z
-
visitBackwards
Visits the code points of a string in backward (right to left) direction.- Parameters:
text
- the stringstyle
- the style of the stringvisitor
- the visitor- Returns:
true
if the full string was visited, orfalse
indicating thevisitor
terminated half-way- Mappings:
Namespace Name Mixin selector named visitBackwards
Lnet/minecraft/text/TextVisitFactory;visitBackwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
intermediary method_27478
Lnet/minecraft/class_5223;method_27478(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z
official b
Lbaz;b(Ljava/lang/String;Lys;Lazr;)Z
-
visitFormatted
Visits the code points of a string, applying the formatting codes within.The visit is in forward direction.
- Parameters:
text
- the string visitedstyle
- the style of the stringvisitor
- the visitor- Returns:
true
if the full string was visited, orfalse
indicating thevisitor
terminated half-way- Mappings:
Namespace Name Mixin selector named visitFormatted
Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
intermediary method_27479
Lnet/minecraft/class_5223;method_27479(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z
official c
Lbaz;c(Ljava/lang/String;Lys;Lazr;)Z
-
visitFormatted
public static boolean visitFormatted(String text, int startIndex, Style style, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.The visit is in forward direction.
- Parameters:
text
- the string visitedstartIndex
- the starting index of the visitstyle
- the style of the string- Returns:
true
if the full string was visited, orfalse
indicating thevisitor
terminated half-way- Mappings:
Namespace Name Mixin selector named visitFormatted
Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
intermediary method_27472
Lnet/minecraft/class_5223;method_27472(Ljava/lang/String;ILnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z
official a
Lbaz;a(Ljava/lang/String;ILys;Lazr;)Z
-
visitFormatted
public static boolean visitFormatted(String text, int startIndex, Style startingStyle, Style resetStyle, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.The visit is in forward direction.
- Parameters:
text
- the string visitedstartIndex
- the starting index of the visitstartingStyle
- the style of the string when the visit startsresetStyle
- the style to reset to when a§r
formatting code is encounteredvisitor
- the visitor- Returns:
true
if the full string was visited, orfalse
indicating thevisitor
terminated half-way- Mappings:
Namespace Name Mixin selector named visitFormatted
Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
intermediary method_27473
Lnet/minecraft/class_5223;method_27473(Ljava/lang/String;ILnet/minecraft/class_2583;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z
official a
Lbaz;a(Ljava/lang/String;ILys;Lys;Lazr;)Z
-
visitFormatted
Visits the code points for every literal string and the formatting codes supplied by the renderable.The visit is in forward direction.
- Returns:
true
if the full string was visited, orfalse
indicating thevisitor
terminated half-way- See Also:
- Mappings:
Namespace Name Mixin selector named visitFormatted
Lnet/minecraft/text/TextVisitFactory;visitFormatted(Lnet/minecraft/text/StringVisitable;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
intermediary method_27476
Lnet/minecraft/class_5223;method_27476(Lnet/minecraft/class_5348;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z
official a
Lbaz;a(Lya;Lys;Lazr;)Z
-
validateSurrogates
Returns a new string that has all surrogate characters within. The characters are validated from an original stringtext
.- Parameters:
text
- the original string- Returns:
- a new string that has all surrogate characters within
- Mappings:
Namespace Name Mixin selector named validateSurrogates
Lnet/minecraft/text/TextVisitFactory;validateSurrogates(Ljava/lang/String;)Ljava/lang/String;
intermediary method_27471
Lnet/minecraft/class_5223;method_27471(Ljava/lang/String;)Ljava/lang/String;
official a
Lbaz;a(Ljava/lang/String;)Ljava/lang/String;
-
removeFormattingCodes
- Mappings:
Namespace Name Mixin selector named removeFormattingCodes
Lnet/minecraft/text/TextVisitFactory;removeFormattingCodes(Lnet/minecraft/text/StringVisitable;)Ljava/lang/String;
intermediary method_31402
Lnet/minecraft/class_5223;method_31402(Lnet/minecraft/class_5348;)Ljava/lang/String;
official a
Lbaz;a(Lya;)Ljava/lang/String;
-