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 intermediary net/minecraft/class_5223official apqnamed net/minecraft/text/TextVisitFactory
-
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 intermediary field_29861Lnet/minecraft/class_5223;field_29861:Cofficial aLapq;a:Cnamed REPLACEMENT_CHARACTERLnet/minecraft/text/TextVisitFactory;REPLACEMENT_CHARACTER:C
-
VISIT_TERMINATED
- Mappings:
Namespace Name Mixin selector intermediary field_24215Lnet/minecraft/class_5223;field_24215:Ljava/util/Optional;official bLapq;b:Ljava/util/Optional;named VISIT_TERMINATEDLnet/minecraft/text/TextVisitFactory;VISIT_TERMINATED: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 intermediary method_27477Lnet/minecraft/class_5223;method_27477(Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;IC)Zofficial aLapq;a(Lts;Laon;IC)Znamed visitRegularCharacterLnet/minecraft/text/TextVisitFactory;visitRegularCharacter(Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;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 intermediary method_27474Lnet/minecraft/class_5223;method_27474(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLapq;a(Ljava/lang/String;Lts;Laon;)Znamed visitForwardsLnet/minecraft/text/TextVisitFactory;visitForwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)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 intermediary method_27478Lnet/minecraft/class_5223;method_27478(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial bLapq;b(Ljava/lang/String;Lts;Laon;)Znamed visitBackwardsLnet/minecraft/text/TextVisitFactory;visitBackwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)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 intermediary method_27479Lnet/minecraft/class_5223;method_27479(Ljava/lang/String;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial cLapq;c(Ljava/lang/String;Lts;Laon;)Znamed visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)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 intermediary method_27472Lnet/minecraft/class_5223;method_27472(Ljava/lang/String;ILnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLapq;a(Ljava/lang/String;ILts;Laon;)Znamed visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)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 intermediary method_27473Lnet/minecraft/class_5223;method_27473(Ljava/lang/String;ILnet/minecraft/class_2583;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLapq;a(Ljava/lang/String;ILts;Lts;Laon;)Znamed visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)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 intermediary method_27476Lnet/minecraft/class_5223;method_27476(Lnet/minecraft/class_5348;Lnet/minecraft/class_2583;Lnet/minecraft/class_5224;)Zofficial aLapq;a(Lta;Lts;Laon;)Znamed visitFormattedLnet/minecraft/text/TextVisitFactory;visitFormatted(Lnet/minecraft/text/StringVisitable;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)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 intermediary method_27471Lnet/minecraft/class_5223;method_27471(Ljava/lang/String;)Ljava/lang/String;official aLapq;a(Ljava/lang/String;)Ljava/lang/String;named validateSurrogatesLnet/minecraft/text/TextVisitFactory;validateSurrogates(Ljava/lang/String;)Ljava/lang/String;
-
removeFormattingCodes
- Mappings:
Namespace Name Mixin selector intermediary method_31402Lnet/minecraft/class_5223;method_31402(Lnet/minecraft/class_5348;)Ljava/lang/String;official aLapq;a(Lta;)Ljava/lang/String;named removeFormattingCodesLnet/minecraft/text/TextVisitFactory;removeFormattingCodes(Lnet/minecraft/text/StringVisitable;)Ljava/lang/String;
-