类 TextHandler


  • @Environment(CLIENT)
    public class TextHandler
    extends Object
    Mappings:
    Namespace Name
    official duw
    intermediary net/minecraft/class_5225
    named net/minecraft/client/font/TextHandler
    • 字段详细资料

      • widthRetriever

        private final TextHandler.WidthRetriever widthRetriever
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a:Lduw$f;
        intermediary field_24216 Lnet/minecraft/class_5225;field_24216:Lnet/minecraft/class_5225$class_5231;
        named widthRetriever Lnet/minecraft/client/font/TextHandler;widthRetriever:Lnet/minecraft/client/font/TextHandler$WidthRetriever;
    • 构造器详细资料

      • TextHandler

        public TextHandler​(TextHandler.WidthRetriever widthRetriever)
        Mappings:
        Namespace Name Mixin selector
        official <init> Lduw;<init>(Lduw$f;)V
        intermediary <init> Lnet/minecraft/class_5225;<init>(Lnet/minecraft/class_5225$class_5231;)V
        named <init> Lnet/minecraft/client/font/TextHandler;<init>(Lnet/minecraft/client/font/TextHandler$WidthRetriever;)V
    • 方法详细资料

      • getWidth

        public float getWidth​(@Nullable
                              @Nullable String text)
        Returns the width of a string.
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Ljava/lang/String;)F
        intermediary method_27482 Lnet/minecraft/class_5225;method_27482(Ljava/lang/String;)F
        named getWidth Lnet/minecraft/client/font/TextHandler;getWidth(Ljava/lang/String;)F
      • getWidth

        public float getWidth​(StringVisitable text)
        Returns the width of a text.
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Loq;)F
        intermediary method_27488 Lnet/minecraft/class_5225;method_27488(Lnet/minecraft/class_5348;)F
        named getWidth Lnet/minecraft/client/font/TextHandler;getWidth(Lnet/minecraft/text/StringVisitable;)F
      • getWidth

        public float getWidth​(OrderedText text)
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Lagj;)F
        intermediary method_30875 Lnet/minecraft/class_5225;method_30875(Lnet/minecraft/class_5481;)F
        named getWidth Lnet/minecraft/client/font/TextHandler;getWidth(Lnet/minecraft/text/OrderedText;)F
      • getTrimmedLength

        public int getTrimmedLength​(String text,
                                    int maxWidth,
                                    Style style)
        Returns the length of a string when it is trimmed to be at most maxWidth wide.
        参数:
        text - the string to trim
        maxWidth - the max width of the trimmed string
        style - the style of the trimmed string
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Ljava/lang/String;ILox;)I
        intermediary method_27484 Lnet/minecraft/class_5225;method_27484(Ljava/lang/String;ILnet/minecraft/class_2583;)I
        named getTrimmedLength Lnet/minecraft/client/font/TextHandler;getTrimmedLength(Ljava/lang/String;ILnet/minecraft/text/Style;)I
      • trimToWidth

        public String trimToWidth​(String text,
                                  int maxWidth,
                                  Style style)
        Trim a string to be at most maxWidth wide.
        参数:
        text - the string to trim
        maxWidth - the max width of the trimmed string
        style - the style of the trimmed string
        返回:
        the trimmed string
        Mappings:
        Namespace Name Mixin selector
        official b Lduw;b(Ljava/lang/String;ILox;)Ljava/lang/String;
        intermediary method_27494 Lnet/minecraft/class_5225;method_27494(Ljava/lang/String;ILnet/minecraft/class_2583;)Ljava/lang/String;
        named trimToWidth Lnet/minecraft/client/font/TextHandler;trimToWidth(Ljava/lang/String;ILnet/minecraft/text/Style;)Ljava/lang/String;
      • trimToWidthBackwards

        public String trimToWidthBackwards​(String text,
                                           int maxWidth,
                                           Style style)
        Trim a string from right to left to be at most maxWidth wide.
        参数:
        text - the string to trim
        maxWidth - the max width of the trimmed string
        style - the style of the trimmed string
        返回:
        the trimmed string
        Mappings:
        Namespace Name Mixin selector
        official c Lduw;c(Ljava/lang/String;ILox;)Ljava/lang/String;
        intermediary method_27497 Lnet/minecraft/class_5225;method_27497(Ljava/lang/String;ILnet/minecraft/class_2583;)Ljava/lang/String;
        named trimToWidthBackwards Lnet/minecraft/client/font/TextHandler;trimToWidthBackwards(Ljava/lang/String;ILnet/minecraft/text/Style;)Ljava/lang/String;
      • method_35715

        public int method_35715​(String string,
                                int int2,
                                Style style)
        Mappings:
        Namespace Name Mixin selector
        official d Lduw;d(Ljava/lang/String;ILox;)I
        intermediary method_35715 Lnet/minecraft/class_5225;method_35715(Ljava/lang/String;ILnet/minecraft/class_2583;)I
        named method_35715 Lnet/minecraft/client/font/TextHandler;method_35715(Ljava/lang/String;ILnet/minecraft/text/Style;)I
      • getStyleAt

        @Nullable
        public @Nullable Style getStyleAt​(StringVisitable text,
                                          int x)
        Gets the style at the x position in a text.
        参数:
        x - the position in the text
        返回:
        a style
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Loq;I)Lox;
        intermediary method_27489 Lnet/minecraft/class_5225;method_27489(Lnet/minecraft/class_5348;I)Lnet/minecraft/class_2583;
        named getStyleAt Lnet/minecraft/client/font/TextHandler;getStyleAt(Lnet/minecraft/text/StringVisitable;I)Lnet/minecraft/text/Style;
      • getStyleAt

        @Nullable
        public @Nullable Style getStyleAt​(OrderedText text,
                                          int x)
        Gets the style at the x position in a text.
        参数:
        x - the position in the text
        返回:
        a style
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Lagj;I)Lox;
        intermediary method_30876 Lnet/minecraft/class_5225;method_30876(Lnet/minecraft/class_5481;I)Lnet/minecraft/class_2583;
        named getStyleAt Lnet/minecraft/client/font/TextHandler;getStyleAt(Lnet/minecraft/text/OrderedText;I)Lnet/minecraft/text/Style;
      • method_35716

        public String method_35716​(String string,
                                   int int2,
                                   Style style)
        Mappings:
        Namespace Name Mixin selector
        official e Lduw;e(Ljava/lang/String;ILox;)Ljava/lang/String;
        intermediary method_35716 Lnet/minecraft/class_5225;method_35716(Ljava/lang/String;ILnet/minecraft/class_2583;)Ljava/lang/String;
        named method_35716 Lnet/minecraft/client/font/TextHandler;method_35716(Ljava/lang/String;ILnet/minecraft/text/Style;)Ljava/lang/String;
      • trimToWidth

        public StringVisitable trimToWidth​(StringVisitable text,
                                           int width,
                                           Style style)
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Loq;ILox;)Loq;
        intermediary method_27490 Lnet/minecraft/class_5225;method_27490(Lnet/minecraft/class_5348;ILnet/minecraft/class_2583;)Lnet/minecraft/class_5348;
        named trimToWidth Lnet/minecraft/client/font/TextHandler;trimToWidth(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/text/Style;)Lnet/minecraft/text/StringVisitable;
      • method_35717

        public int method_35717​(String string,
                                int int2,
                                Style style)
        Mappings:
        Namespace Name Mixin selector
        official f Lduw;f(Ljava/lang/String;ILox;)I
        intermediary method_35717 Lnet/minecraft/class_5225;method_35717(Ljava/lang/String;ILnet/minecraft/class_2583;)I
        named method_35717 Lnet/minecraft/client/font/TextHandler;method_35717(Ljava/lang/String;ILnet/minecraft/text/Style;)I
      • moveCursorByWords

        public static int moveCursorByWords​(String text,
                                            int offset,
                                            int cursor,
                                            boolean consumeSpaceOrBreak)
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Ljava/lang/String;IIZ)I
        intermediary method_27483 Lnet/minecraft/class_5225;method_27483(Ljava/lang/String;IIZ)I
        named moveCursorByWords Lnet/minecraft/client/font/TextHandler;moveCursorByWords(Ljava/lang/String;IIZ)I
      • wrapLines

        public void wrapLines​(String text,
                              int maxWidth,
                              Style style,
                              boolean retainTrailingWordSplit,
                              TextHandler.LineWrappingConsumer consumer)
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Ljava/lang/String;ILox;ZLduw$d;)V
        intermediary method_27485 Lnet/minecraft/class_5225;method_27485(Ljava/lang/String;ILnet/minecraft/class_2583;ZLnet/minecraft/class_5225$class_5229;)V
        named wrapLines Lnet/minecraft/client/font/TextHandler;wrapLines(Ljava/lang/String;ILnet/minecraft/text/Style;ZLnet/minecraft/client/font/TextHandler$LineWrappingConsumer;)V
      • wrapLines

        public List<StringVisitable> wrapLines​(String text,
                                               int maxWidth,
                                               Style style)
        Mappings:
        Namespace Name Mixin selector
        official g Lduw;g(Ljava/lang/String;ILox;)Ljava/util/List;
        intermediary method_27498 Lnet/minecraft/class_5225;method_27498(Ljava/lang/String;ILnet/minecraft/class_2583;)Ljava/util/List;
        named wrapLines Lnet/minecraft/client/font/TextHandler;wrapLines(Ljava/lang/String;ILnet/minecraft/text/Style;)Ljava/util/List;
      • wrapLines

        public List<StringVisitable> wrapLines​(StringVisitable text,
                                               int maxWidth,
                                               Style style)
        Mappings:
        Namespace Name Mixin selector
        official b Lduw;b(Loq;ILox;)Ljava/util/List;
        intermediary method_27495 Lnet/minecraft/class_5225;method_27495(Lnet/minecraft/class_5348;ILnet/minecraft/class_2583;)Ljava/util/List;
        named wrapLines Lnet/minecraft/client/font/TextHandler;wrapLines(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/text/Style;)Ljava/util/List;
      • method_35714

        public List<StringVisitable> method_35714​(StringVisitable stringVisitable,
                                                  int int2,
                                                  Style style,
                                                  StringVisitable stringVisitable2)
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Loq;ILox;Loq;)Ljava/util/List;
        intermediary method_35714 Lnet/minecraft/class_5225;method_35714(Lnet/minecraft/class_5348;ILnet/minecraft/class_2583;Lnet/minecraft/class_5348;)Ljava/util/List;
        named method_35714 Lnet/minecraft/client/font/TextHandler;method_35714(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/text/Style;Lnet/minecraft/text/StringVisitable;)Ljava/util/List;
      • wrapLines

        public void wrapLines​(StringVisitable text,
                              int maxWidth,
                              Style style,
                              BiConsumer<StringVisitable,​Boolean> biConsumer)
        Mappings:
        Namespace Name Mixin selector
        official a Lduw;a(Loq;ILox;Ljava/util/function/BiConsumer;)V
        intermediary method_29971 Lnet/minecraft/class_5225;method_29971(Lnet/minecraft/class_5348;ILnet/minecraft/class_2583;Ljava/util/function/BiConsumer;)V
        named wrapLines Lnet/minecraft/client/font/TextHandler;wrapLines(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/text/Style;Ljava/util/function/BiConsumer;)V