Class TranslatableTextContent

java.lang.Object
net.minecraft.text.TranslatableTextContent
All Implemented Interfaces:
TextContent

public class TranslatableTextContent extends Object implements TextContent
Mappings:
Namespace Name
named net/minecraft/text/TranslatableTextContent
intermediary net/minecraft/class_2588
official za
  • Field Details

    • EMPTY_ARGUMENTS

      public static final Object[] EMPTY_ARGUMENTS
      Mappings:
      Namespace Name Mixin selector
      named EMPTY_ARGUMENTS Lnet/minecraft/text/TranslatableTextContent;EMPTY_ARGUMENTS:[Ljava/lang/Object;
      intermediary field_24367 Lnet/minecraft/class_2588;field_24367:[Ljava/lang/Object;
      official a Lza;a:[Ljava/lang/Object;
    • OBJECT_ARGUMENT_CODEC

      private static final com.mojang.serialization.Codec<Object> OBJECT_ARGUMENT_CODEC
      Mappings:
      Namespace Name Mixin selector
      named OBJECT_ARGUMENT_CODEC Lnet/minecraft/text/TranslatableTextContent;OBJECT_ARGUMENT_CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_46635 Lnet/minecraft/class_2588;field_46635:Lcom/mojang/serialization/Codec;
      official d Lza;d:Lcom/mojang/serialization/Codec;
    • ARGUMENT_CODEC

      private static final com.mojang.serialization.Codec<Object> ARGUMENT_CODEC
      Mappings:
      Namespace Name Mixin selector
      named ARGUMENT_CODEC Lnet/minecraft/text/TranslatableTextContent;ARGUMENT_CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_46636 Lnet/minecraft/class_2588;field_46636:Lcom/mojang/serialization/Codec;
      official e Lza;e:Lcom/mojang/serialization/Codec;
    • CODEC

      public static final com.mojang.serialization.MapCodec<TranslatableTextContent> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/text/TranslatableTextContent;CODEC:Lcom/mojang/serialization/MapCodec;
      intermediary field_46633 Lnet/minecraft/class_2588;field_46633:Lcom/mojang/serialization/MapCodec;
      official b Lza;b:Lcom/mojang/serialization/MapCodec;
    • TYPE

      public static final TextContent.Type<TranslatableTextContent> TYPE
      Mappings:
      Namespace Name Mixin selector
      named TYPE Lnet/minecraft/text/TranslatableTextContent;TYPE:Lnet/minecraft/text/TextContent$Type;
      intermediary field_46634 Lnet/minecraft/class_2588;field_46634:Lnet/minecraft/class_7417$class_8823;
      official c Lza;c:Lxq$a;
    • LITERAL_PERCENT_SIGN

      private static final StringVisitable LITERAL_PERCENT_SIGN
      Mappings:
      Namespace Name Mixin selector
      named LITERAL_PERCENT_SIGN Lnet/minecraft/text/TranslatableTextContent;LITERAL_PERCENT_SIGN:Lnet/minecraft/text/StringVisitable;
      intermediary field_24368 Lnet/minecraft/class_2588;field_24368:Lnet/minecraft/class_5348;
      official f Lza;f:Lxu;
    • NULL_ARGUMENT

      private static final StringVisitable NULL_ARGUMENT
      Mappings:
      Namespace Name Mixin selector
      named NULL_ARGUMENT Lnet/minecraft/text/TranslatableTextContent;NULL_ARGUMENT:Lnet/minecraft/text/StringVisitable;
      intermediary field_24369 Lnet/minecraft/class_2588;field_24369:Lnet/minecraft/class_5348;
      official g Lza;g:Lxu;
    • ARG_FORMAT

      private static final Pattern ARG_FORMAT
      Mappings:
      Namespace Name Mixin selector
      named ARG_FORMAT Lnet/minecraft/text/TranslatableTextContent;ARG_FORMAT:Ljava/util/regex/Pattern;
      intermediary field_11872 Lnet/minecraft/class_2588;field_11872:Ljava/util/regex/Pattern;
      official m Lza;m:Ljava/util/regex/Pattern;
    • key

      private final String key
      Mappings:
      Namespace Name Mixin selector
      named key Lnet/minecraft/text/TranslatableTextContent;key:Ljava/lang/String;
      intermediary field_11876 Lnet/minecraft/class_2588;field_11876:Ljava/lang/String;
      official h Lza;h:Ljava/lang/String;
    • fallback

      @Nullable private final @Nullable String fallback
      Mappings:
      Namespace Name Mixin selector
      named fallback Lnet/minecraft/text/TranslatableTextContent;fallback:Ljava/lang/String;
      intermediary field_41875 Lnet/minecraft/class_2588;field_41875:Ljava/lang/String;
      official i Lza;i:Ljava/lang/String;
    • args

      private final Object[] args
      Mappings:
      Namespace Name Mixin selector
      named args Lnet/minecraft/text/TranslatableTextContent;args:[Ljava/lang/Object;
      intermediary field_11875 Lnet/minecraft/class_2588;field_11875:[Ljava/lang/Object;
      official j Lza;j:[Ljava/lang/Object;
    • languageCache

      @Nullable private @Nullable Language languageCache
      Mappings:
      Namespace Name Mixin selector
      named languageCache Lnet/minecraft/text/TranslatableTextContent;languageCache:Lnet/minecraft/util/Language;
      intermediary field_25317 Lnet/minecraft/class_2588;field_25317:Lnet/minecraft/class_2477;
      official k Lza;k:Lun;
    • translations

      private List<StringVisitable> translations
      Mappings:
      Namespace Name Mixin selector
      named translations Lnet/minecraft/text/TranslatableTextContent;translations:Ljava/util/List;
      intermediary field_11877 Lnet/minecraft/class_2588;field_11877:Ljava/util/List;
      official l Lza;l:Ljava/util/List;
  • Constructor Details

    • TranslatableTextContent

      public TranslatableTextContent(String key, @Nullable @Nullable String fallback, Object[] args)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/text/TranslatableTextContent;<init>(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
      intermediary <init> Lnet/minecraft/class_2588;<init>(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
      official <init> Lza;<init>(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
  • Method Details

    • validate

      private static com.mojang.serialization.DataResult<Object> validate(@Nullable @Nullable Object object)
      Mappings:
      Namespace Name Mixin selector
      named validate Lnet/minecraft/text/TranslatableTextContent;validate(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      intermediary method_54245 Lnet/minecraft/class_2588;method_54245(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      official b Lza;b(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
    • isPrimitive

      public static boolean isPrimitive(@Nullable @Nullable Object argument)
      Returns whether argument is primitive.

      Primitives include numbers, booleans, and strings. These (along with Text) can be used as translatable text arguments; others need to be converted first.

      Returns:
      whether argument is primitive
      Mappings:
      Namespace Name Mixin selector
      named isPrimitive Lnet/minecraft/text/TranslatableTextContent;isPrimitive(Ljava/lang/Object;)Z
      intermediary method_54238 Lnet/minecraft/class_2588;method_54238(Ljava/lang/Object;)Z
      official a Lza;a(Ljava/lang/Object;)Z
    • toOptionalList

      private static Optional<List<Object>> toOptionalList(Object[] args)
      Mappings:
      Namespace Name Mixin selector
      named toOptionalList Lnet/minecraft/text/TranslatableTextContent;toOptionalList([Ljava/lang/Object;)Ljava/util/Optional;
      intermediary method_54244 Lnet/minecraft/class_2588;method_54244([Ljava/lang/Object;)Ljava/util/Optional;
      official a Lza;a([Ljava/lang/Object;)Ljava/util/Optional;
    • toArray

      private static Object[] toArray(Optional<List<Object>> args)
      Mappings:
      Namespace Name Mixin selector
      named toArray Lnet/minecraft/text/TranslatableTextContent;toArray(Ljava/util/Optional;)[Ljava/lang/Object;
      intermediary method_54241 Lnet/minecraft/class_2588;method_54241(Ljava/util/Optional;)[Ljava/lang/Object;
      official a Lza;a(Ljava/util/Optional;)[Ljava/lang/Object;
    • of

      private static TranslatableTextContent of(String key, Optional<String> fallback, Optional<List<Object>> args)
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/text/TranslatableTextContent;of(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;)Lnet/minecraft/text/TranslatableTextContent;
      intermediary method_54239 Lnet/minecraft/class_2588;method_54239(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;)Lnet/minecraft/class_2588;
      official a Lza;a(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;)Lza;
    • getType

      public TextContent.Type<?> getType()
      Specified by:
      getType in interface TextContent
      Mappings:
      Namespace Name Mixin selector
      named getType Lnet/minecraft/text/TextContent;getType()Lnet/minecraft/text/TextContent$Type;
      intermediary method_54163 Lnet/minecraft/class_7417;method_54163()Lnet/minecraft/class_7417$class_8823;
      official a Lxq;a()Lxq$a;
    • updateTranslations

      private void updateTranslations()
      Mappings:
      Namespace Name Mixin selector
      named updateTranslations Lnet/minecraft/text/TranslatableTextContent;updateTranslations()V
      intermediary method_11025 Lnet/minecraft/class_2588;method_11025()V
      official e Lza;e()V
    • forEachPart

      private void forEachPart(String translation, Consumer<StringVisitable> partsConsumer)
      Mappings:
      Namespace Name Mixin selector
      named forEachPart Lnet/minecraft/text/TranslatableTextContent;forEachPart(Ljava/lang/String;Ljava/util/function/Consumer;)V
      intermediary method_11024 Lnet/minecraft/class_2588;method_11024(Ljava/lang/String;Ljava/util/function/Consumer;)V
      official a Lza;a(Ljava/lang/String;Ljava/util/function/Consumer;)V
    • getArg

      private StringVisitable getArg(int index)
      Mappings:
      Namespace Name Mixin selector
      named getArg Lnet/minecraft/text/TranslatableTextContent;getArg(I)Lnet/minecraft/text/StringVisitable;
      intermediary method_29434 Lnet/minecraft/class_2588;method_29434(I)Lnet/minecraft/class_5348;
      official a Lza;a(I)Lxu;
    • visit

      public <T> Optional<T> visit(StringVisitable.StyledVisitor<T> visitor, Style style)
      Visits this content. Returns a value if the visitor terminates amid the visit, or Optional.empty() if it proceeds.
      Specified by:
      visit in interface TextContent
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named visit Lnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
      intermediary method_27660 Lnet/minecraft/class_7417;method_27660(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;
      official a Lxq;a(Lxu$b;Lym;)Ljava/util/Optional;
    • visit

      public <T> Optional<T> visit(StringVisitable.Visitor<T> visitor)
      Visits this content. Returns a value if the visitor terminates amid the visit, or Optional.empty() if it proceeds.
      Specified by:
      visit in interface TextContent
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named visit Lnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
      intermediary method_27659 Lnet/minecraft/class_7417;method_27659(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;
      official a Lxq;a(Lxu$a;)Ljava/util/Optional;
    • parse

      public MutableText parse(@Nullable @Nullable ServerCommandSource source, @Nullable @Nullable Entity sender, int depth) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Parses this content into a basic mutable text without custom style or siblings. The resulting text may or may not have this content.
      Specified by:
      parse in interface TextContent
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
      Mappings:
      Namespace Name Mixin selector
      named parse Lnet/minecraft/text/TextContent;parse(Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/entity/Entity;I)Lnet/minecraft/text/MutableText;
      intermediary method_10890 Lnet/minecraft/class_7417;method_10890(Lnet/minecraft/class_2168;Lnet/minecraft/class_1297;I)Lnet/minecraft/class_5250;
      official a Lxq;a(Lep;Lbsv;I)Lyd;
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      named equals Lnet/minecraft/text/TranslatableTextContent;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_2588;equals(Ljava/lang/Object;)Z
      official equals Lza;equals(Ljava/lang/Object;)Z
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getKey

      public String getKey()
      Mappings:
      Namespace Name Mixin selector
      named getKey Lnet/minecraft/text/TranslatableTextContent;getKey()Ljava/lang/String;
      intermediary method_11022 Lnet/minecraft/class_2588;method_11022()Ljava/lang/String;
      official b Lza;b()Ljava/lang/String;
    • getFallback

      @Nullable public @Nullable String getFallback()
      Mappings:
      Namespace Name Mixin selector
      named getFallback Lnet/minecraft/text/TranslatableTextContent;getFallback()Ljava/lang/String;
      intermediary method_48323 Lnet/minecraft/class_2588;method_48323()Ljava/lang/String;
      official c Lza;c()Ljava/lang/String;
    • getArgs

      public Object[] getArgs()
      Mappings:
      Namespace Name Mixin selector
      named getArgs Lnet/minecraft/text/TranslatableTextContent;getArgs()[Ljava/lang/Object;
      intermediary method_11023 Lnet/minecraft/class_2588;method_11023()[Ljava/lang/Object;
      official d Lza;d()[Ljava/lang/Object;