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/TextVisitFactoryintermediary net/minecraft/class_5223official azj
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final char -
Constructor Summary
Constructors -
Method Summary
Modifier 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_CHARACTER
private static final char REPLACEMENT_CHARACTER- See Also:
- Mappings:
Namespace Name Mixin selector named REPLACEMENT_CHARACTERLnet/minecraft/text/TextVisitFactory;REPLACEMENT_CHARACTER:Cintermediary field_29861Lnet/minecraft/class_5223;field_29861:Cofficial aLazj;a:C
-
VISIT_TERMINATED
- Mappings:
Namespace Name Mixin selector named VISIT_TERMINATEDLnet/minecraft/text/TextVisitFactory;VISIT_TERMINATED:Ljava/util/Optional;intermediary field_24215Lnet/minecraft/class_5223;field_24215:Ljava/util/Optional;official bLazj;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 visitRegularCharacterLnet/minecraft/text/TextVisitFactory;visitRegularCharacter(Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;IC)Zintermediary method_27477Lnet/minecraft/class_5223;method_27477(Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;IC)Zofficial aLazj;a(Lxw;Layb;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:
trueif the full string was visited, orfalseindicating thevisitorterminated half-way- Mappings:
Namespace Name Mixin selector named visitForwardsLnet/minecraft/text/TextVisitFactory;visitForwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Zintermediary method_27474Lnet/minecraft/class_5223;method_27474(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLazj;a(Ljava/lang/String;Lxw;Layb;)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:
trueif the full string was visited, orfalseindicating thevisitorterminated half-way- Mappings:
Namespace Name Mixin selector named visitBackwardsLnet/minecraft/text/TextVisitFactory;visitBackwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Zintermediary method_27478Lnet/minecraft/class_5223;method_27478(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial bLazj;b(Ljava/lang/String;Lxw;Layb;)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:
trueif the full string was visited, orfalseindicating thevisitorterminated half-way- Mappings:
Namespace Name Mixin selector named visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Zintermediary method_27479Lnet/minecraft/class_5223;method_27479(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial cLazj;c(Ljava/lang/String;Lxw;Layb;)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:
trueif the full string was visited, orfalseindicating thevisitorterminated half-way- Mappings:
Namespace Name Mixin selector named visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Zintermediary method_27472Lnet/minecraft/class_5223;method_27472(Ljava/lang/String;ILnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLazj;a(Ljava/lang/String;ILxw;Layb;)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§rformatting code is encounteredvisitor- the visitor- Returns:
trueif the full string was visited, orfalseindicating thevisitorterminated half-way- Mappings:
Namespace Name Mixin selector named visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Zintermediary method_27473Lnet/minecraft/class_5223;method_27473(Ljava/lang/String;ILnet/minecraft/class_2583;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLazj;a(Ljava/lang/String;ILxw;Lxw;Layb;)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:
trueif the full string was visited, orfalseindicating thevisitorterminated half-way- See Also:
- Mappings:
Namespace Name Mixin selector named visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Lnet/minecraft/text/StringVisitable;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Zintermediary method_27476Lnet/minecraft/class_5223;method_27476(Lnet/minecraft/class_5348;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLazj;a(Lxe;Lxw;Layb;)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 validateSurrogatesLnet/minecraft/text/TextVisitFactory;validateSurrogates(Ljava/lang/String;)Ljava/lang/String;intermediary method_27471Lnet/minecraft/class_5223;method_27471(Ljava/lang/String;)Ljava/lang/String;official aLazj;a(Ljava/lang/String;)Ljava/lang/String;
-
removeFormattingCodes
- Mappings:
Namespace Name Mixin selector named removeFormattingCodesLnet/minecraft/text/TextVisitFactory;removeFormattingCodes(Lnet/minecraft/text/StringVisitable;)Ljava/lang/String;intermediary method_31402Lnet/minecraft/class_5223;method_31402(Lnet/minecraft/class_5348;)Ljava/lang/String;official aLazj;a(Lxe;)Ljava/lang/String;
-