类 TextVisitFactory


  • public class TextVisitFactory
    extends Object
    A utility class for visiting the characters of strings, handling surrogate code points and formatting codes.
    Mappings:
    Namespace Name
    official agy
    intermediary net/minecraft/class_5223
    named net/minecraft/client/font/TextVisitFactory
    • 字段详细资料

      • field_29861

        private static final char field_29861
        另请参阅:
        常量字段值
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;a:C
        intermediary field_29861 Lnet/minecraft/class_5223;field_29861:C
        named field_29861 Lnet/minecraft/client/font/TextVisitFactory;field_29861:C
      • VISIT_TERMINATED

        private static final Optional<Object> VISIT_TERMINATED
        Mappings:
        Namespace Name Mixin selector
        official b Lagy;b:Ljava/util/Optional;
        intermediary field_24215 Lnet/minecraft/class_5223;field_24215:Ljava/util/Optional;
        named VISIT_TERMINATED Lnet/minecraft/client/font/TextVisitFactory;VISIT_TERMINATED:Ljava/util/Optional;
    • 构造器详细资料

      • TextVisitFactory

        public TextVisitFactory()
    • 方法详细资料

      • visitRegularCharacter

        private static boolean visitRegularCharacter​(Style style,
                                                     CharacterVisitor visitor,
                                                     int index,
                                                     char c)
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;a(Lox;Lagk;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/client/font/TextVisitFactory;visitRegularCharacter(Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;IC)Z
      • visitForwards

        public static boolean visitForwards​(String text,
                                            Style style,
                                            CharacterVisitor visitor)
        Visits the code points of a string in forward (left to right) direction.
        参数:
        text - the string
        style - the style of the string
        visitor - the visitor of characters
        返回:
        true if the full string was visited, or false indicating the visitor terminated half-way
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;a(Ljava/lang/String;Lox;Lagk;)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/client/font/TextVisitFactory;visitForwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
      • visitBackwards

        public static boolean visitBackwards​(String text,
                                             Style style,
                                             CharacterVisitor visitor)
        Visits the code points of a string in backward (right to left) direction.
        参数:
        text - the string
        style - the style of the string
        visitor - the visitor
        返回:
        true if the full string was visited, or false indicating the visitor terminated half-way
        Mappings:
        Namespace Name Mixin selector
        official b Lagy;b(Ljava/lang/String;Lox;Lagk;)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/client/font/TextVisitFactory;visitBackwards(Ljava/lang/String;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
      • visitFormatted

        public static boolean visitFormatted​(String text,
                                             Style style,
                                             CharacterVisitor visitor)
        Visits the code points of a string, applying the formatting codes within.

        The visit is in forward direction.

        参数:
        text - the string visited
        style - the style of the string
        visitor - the visitor
        返回:
        true if the full string was visited, or false indicating the visitor terminated half-way
        Mappings:
        Namespace Name Mixin selector
        official c Lagy;c(Ljava/lang/String;Lox;Lagk;)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/client/font/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.

        参数:
        text - the string visited
        startIndex - the starting index of the visit
        style - the style of the string
        返回:
        true if the full string was visited, or false indicating the visitor terminated half-way
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;a(Ljava/lang/String;ILox;Lagk;)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/client/font/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.

        参数:
        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 §r formatting code is encountered
        visitor - the visitor
        返回:
        true if the full string was visited, or false indicating the visitor terminated half-way
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;a(Ljava/lang/String;ILox;Lox;Lagk;)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/client/font/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
      • visitFormatted

        public 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.

        The visit is in forward direction.

        返回:
        true if the full string was visited, or false indicating the visitor terminated half-way
        另请参阅:
        StringVisitable.visit(StringVisitable.StyledVisitor, Style)
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;a(Loq;Lox;Lagk;)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/client/font/TextVisitFactory;visitFormatted(Lnet/minecraft/text/StringVisitable;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z
      • validateSurrogates

        public static String validateSurrogates​(String text)
        Returns a new string that has all surrogate characters within validated from an original string.
        参数:
        text - the original string
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;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/client/font/TextVisitFactory;validateSurrogates(Ljava/lang/String;)Ljava/lang/String;
      • removeFormattingCodes

        public static String removeFormattingCodes​(StringVisitable text)
        Mappings:
        Namespace Name Mixin selector
        official a Lagy;a(Loq;)Ljava/lang/String;
        intermediary method_31402 Lnet/minecraft/class_5223;method_31402(Lnet/minecraft/class_5348;)Ljava/lang/String;
        named removeFormattingCodes Lnet/minecraft/client/font/TextVisitFactory;removeFormattingCodes(Lnet/minecraft/text/StringVisitable;)Ljava/lang/String;