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 - official - apq- intermediary - net/minecraft/class_5223- named - net/minecraft/text/TextVisitFactory
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final char
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Stringstatic StringvalidateSurrogates(String text) Returns a new string that has all surrogate characters within.static booleanvisitBackwards(String text, Style style, CharacterVisitor visitor) Visits the code points of a string in backward (right to left) direction.static booleanvisitFormatted(String text, int startIndex, Style style, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.static booleanvisitFormatted(String text, int startIndex, Style startingStyle, Style resetStyle, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.static booleanvisitFormatted(String text, Style style, CharacterVisitor visitor) Visits the code points of a string, applying the formatting codes within.static booleanvisitFormatted(StringVisitable text, Style style, CharacterVisitor visitor) Visits the code points for every literal string and the formatting codes supplied by the renderable.static booleanvisitForwards(String text, Style style, CharacterVisitor visitor) Visits the code points of a string in forward (left to right) direction.private static booleanvisitRegularCharacter(Style style, CharacterVisitor visitor, int index, char c) 
- 
Field Details- 
REPLACEMENT_CHARACTERprivate static final char REPLACEMENT_CHARACTER- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lapq;a:C- intermediary - field_29861- Lnet/minecraft/class_5223;field_29861:C- named - REPLACEMENT_CHARACTER- Lnet/minecraft/text/TextVisitFactory;REPLACEMENT_CHARACTER:C
 
- 
VISIT_TERMINATED- Mappings:
- Namespace - Name - Mixin selector - official - b- Lapq;b:Ljava/util/Optional;- intermediary - field_24215- Lnet/minecraft/class_5223;field_24215:Ljava/util/Optional;- named - VISIT_TERMINATED- Lnet/minecraft/text/TextVisitFactory;VISIT_TERMINATED:Ljava/util/Optional;
 
 
- 
- 
Constructor Details- 
TextVisitFactorypublic TextVisitFactory()
 
- 
- 
Method Details- 
visitRegularCharacterprivate static boolean visitRegularCharacter(Style style, CharacterVisitor visitor, int index, char c) - Mappings:
- Namespace - Name - Mixin selector - official - a- Lapq;a(Lts;Laon;IC)Z- intermediary - method_27477- Lnet/minecraft/class_5223;method_27477(Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;IC)Z- named - visitRegularCharacter- Lnet/minecraft/text/TextVisitFactory;visitRegularCharacter(Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;IC)Z
 
- 
visitForwardsVisits the code points of a string in forward (left to right) direction.- Parameters:
- text- the string
- style- the style of the string
- visitor- the visitor of characters
- Returns:
- trueif the full string was visited, or- falseindicating the- visitorterminated half-way
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lapq;a(Ljava/lang/String;Lts;Laon;)Z- intermediary - method_27474- Lnet/minecraft/class_5223;method_27474(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z- named - visitForwards- Lnet/minecraft/text/TextVisitFactory;visitForwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
 
- 
visitBackwardsVisits the code points of a string in backward (right to left) direction.- Parameters:
- text- the string
- style- the style of the string
- visitor- the visitor
- Returns:
- trueif the full string was visited, or- falseindicating the- visitorterminated half-way
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lapq;b(Ljava/lang/String;Lts;Laon;)Z- intermediary - method_27478- Lnet/minecraft/class_5223;method_27478(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z- named - visitBackwards- Lnet/minecraft/text/TextVisitFactory;visitBackwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
 
- 
visitFormattedVisits the code points of a string, applying the formatting codes within.The visit is in forward direction. - Parameters:
- text- the string visited
- style- the style of the string
- visitor- the visitor
- Returns:
- trueif the full string was visited, or- falseindicating the- visitorterminated half-way
- Mappings:
- Namespace - Name - Mixin selector - official - c- Lapq;c(Ljava/lang/String;Lts;Laon;)Z- intermediary - method_27479- Lnet/minecraft/class_5223;method_27479(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z- named - visitFormatted- Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
 
- 
visitFormattedpublic 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 visited
- startIndex- the starting index of the visit
- style- the style of the string
- Returns:
- trueif the full string was visited, or- falseindicating the- visitorterminated half-way
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lapq;a(Ljava/lang/String;ILts;Laon;)Z- intermediary - method_27472- Lnet/minecraft/class_5223;method_27472(Ljava/lang/String;ILnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z- named - visitFormatted- Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
 
- 
visitFormattedpublic 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 visited
- startIndex- the starting index of the visit
- startingStyle- the style of the string when the visit starts
- resetStyle- the style to reset to when a- §rformatting code is encountered
- visitor- the visitor
- Returns:
- trueif the full string was visited, or- falseindicating the- visitorterminated half-way
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lapq;a(Ljava/lang/String;ILts;Lts;Laon;)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- named - visitFormatted- Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
 
- 
visitFormattedVisits the code points for every literal string and the formatting codes supplied by the renderable.The visit is in forward direction. - Returns:
- trueif the full string was visited, or- falseindicating the- visitorterminated half-way
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lapq;a(Lta;Lts;Laon;)Z- intermediary - method_27476- Lnet/minecraft/class_5223;method_27476(Lnet/minecraft/class_5348;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Z- named - visitFormatted- Lnet/minecraft/text/TextVisitFactory;visitFormatted(Lnet/minecraft/text/StringVisitable;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
 
- 
validateSurrogatesReturns 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 - official - a- Lapq;a(Ljava/lang/String;)Ljava/lang/String;- intermediary - method_27471- Lnet/minecraft/class_5223;method_27471(Ljava/lang/String;)Ljava/lang/String;- named - validateSurrogates- Lnet/minecraft/text/TextVisitFactory;validateSurrogates(Ljava/lang/String;)Ljava/lang/String;
 
- 
removeFormattingCodes- Mappings:
- Namespace - Name - Mixin selector - official - a- Lapq;a(Lta;)Ljava/lang/String;- intermediary - method_31402- Lnet/minecraft/class_5223;method_31402(Lnet/minecraft/class_5348;)Ljava/lang/String;- named - removeFormattingCodes- Lnet/minecraft/text/TextVisitFactory;removeFormattingCodes(Lnet/minecraft/text/StringVisitable;)Ljava/lang/String;
 
 
-