类 TranslatableText
- java.lang.Object
-
- net.minecraft.text.BaseText
-
- net.minecraft.text.TranslatableText
-
- 所有已实现的接口:
com.mojang.brigadier.Message,MutableText,ParsableText,StringVisitable,Text
public class TranslatableText extends BaseText implements ParsableText
- Mappings:
Namespace Name official pbintermediary net/minecraft/class_2588named net/minecraft/text/TranslatableText
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 net.minecraft.text.StringVisitable
StringVisitable.StyledVisitor<T>, StringVisitable.Visitor<T>
-
从接口继承的嵌套类/接口 net.minecraft.text.Text
Text.Serializer
-
-
字段概要
字段 修饰符和类型 字段 说明 private static PatternARG_FORMATprivate Object[]argsprivate static Object[]EMPTY_ARGUMENTSprivate Stringkeyprivate @Nullable LanguagelanguageCacheprivate static StringVisitableLITERAL_PERCENT_SIGNprivate static StringVisitableNULL_ARGUMENTprivate List<StringVisitable>translations-
从接口继承的字段 net.minecraft.text.StringVisitable
EMPTY, TERMINATE_VISIT
-
-
构造器概要
构造器 构造器 说明 TranslatableText(String key)TranslatableText(String key, Object[] args)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 TranslatableTextcopy()Copies the text itself, excluding the styles or siblings.booleanequals(Object obj)private StringVisitablegetArg(int index)Object[]getArgs()StringgetKey()inthashCode()MutableTextparse(@Nullable ServerCommandSource source, @Nullable Entity sender, int depth)private voidsetTranslation(String translation)StringtoString()private voidupdateTranslations()<T> Optional<T>visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)Visits the text itself.<T> Optional<T>visitSelf(StringVisitable.Visitor<T> visitor)Visits the text itself.-
从类继承的方法 net.minecraft.text.BaseText
append, asOrderedText, asString, getSiblings, getStyle, setStyle, shallowCopy
-
从接口继承的方法 net.minecraft.text.Text
asTruncatedString, getString, method_36136, visit, visit
-
-
-
-
字段详细资料
-
EMPTY_ARGUMENTS
private static final Object[] EMPTY_ARGUMENTS
- Mappings:
Namespace Name Mixin selector official dLpb;d:[Ljava/lang/Object;intermediary field_24367Lnet/minecraft/class_2588;field_24367:[Ljava/lang/Object;named EMPTY_ARGUMENTSLnet/minecraft/text/TranslatableText;EMPTY_ARGUMENTS:[Ljava/lang/Object;
-
LITERAL_PERCENT_SIGN
private static final StringVisitable LITERAL_PERCENT_SIGN
- Mappings:
Namespace Name Mixin selector official eLpb;e:Loq;intermediary field_24368Lnet/minecraft/class_2588;field_24368:Lnet/minecraft/class_5348;named LITERAL_PERCENT_SIGNLnet/minecraft/text/TranslatableText;LITERAL_PERCENT_SIGN:Lnet/minecraft/text/StringVisitable;
-
NULL_ARGUMENT
private static final StringVisitable NULL_ARGUMENT
- Mappings:
Namespace Name Mixin selector official fLpb;f:Loq;intermediary field_24369Lnet/minecraft/class_2588;field_24369:Lnet/minecraft/class_5348;named NULL_ARGUMENTLnet/minecraft/text/TranslatableText;NULL_ARGUMENT:Lnet/minecraft/text/StringVisitable;
-
ARG_FORMAT
private static final Pattern ARG_FORMAT
- Mappings:
Namespace Name Mixin selector official kLpb;k:Ljava/util/regex/Pattern;intermediary field_11872Lnet/minecraft/class_2588;field_11872:Ljava/util/regex/Pattern;named ARG_FORMATLnet/minecraft/text/TranslatableText;ARG_FORMAT:Ljava/util/regex/Pattern;
-
key
private final String key
- Mappings:
Namespace Name Mixin selector official gLpb;g:Ljava/lang/String;intermediary field_11876Lnet/minecraft/class_2588;field_11876:Ljava/lang/String;named keyLnet/minecraft/text/TranslatableText;key:Ljava/lang/String;
-
args
private final Object[] args
- Mappings:
Namespace Name Mixin selector official hLpb;h:[Ljava/lang/Object;intermediary field_11875Lnet/minecraft/class_2588;field_11875:[Ljava/lang/Object;named argsLnet/minecraft/text/TranslatableText;args:[Ljava/lang/Object;
-
languageCache
@Nullable private @Nullable Language languageCache
- Mappings:
Namespace Name Mixin selector official iLpb;i:Lmq;intermediary field_25317Lnet/minecraft/class_2588;field_25317:Lnet/minecraft/class_2477;named languageCacheLnet/minecraft/text/TranslatableText;languageCache:Lnet/minecraft/util/Language;
-
translations
private final List<StringVisitable> translations
- Mappings:
Namespace Name Mixin selector official jLpb;j:Ljava/util/List;intermediary field_11877Lnet/minecraft/class_2588;field_11877:Ljava/util/List;named translationsLnet/minecraft/text/TranslatableText;translations:Ljava/util/List;
-
-
构造器详细资料
-
TranslatableText
public TranslatableText(String key)
- Mappings:
Namespace Name Mixin selector official <init>Lpb;<init>(Ljava/lang/String;)Vintermediary <init>Lnet/minecraft/class_2588;<init>(Ljava/lang/String;)Vnamed <init>Lnet/minecraft/text/TranslatableText;<init>(Ljava/lang/String;)V
-
TranslatableText
public TranslatableText(String key, Object[] args)
- Mappings:
Namespace Name Mixin selector official <init>Lpb;<init>(Ljava/lang/String;[Ljava/lang/Object;)Vintermediary <init>Lnet/minecraft/class_2588;<init>(Ljava/lang/String;[Ljava/lang/Object;)Vnamed <init>Lnet/minecraft/text/TranslatableText;<init>(Ljava/lang/String;[Ljava/lang/Object;)V
-
-
方法详细资料
-
updateTranslations
private void updateTranslations()
- Mappings:
Namespace Name Mixin selector official kLpb;k()Vintermediary method_11025Lnet/minecraft/class_2588;method_11025()Vnamed updateTranslationsLnet/minecraft/text/TranslatableText;updateTranslations()V
-
setTranslation
private void setTranslation(String translation)
- Mappings:
Namespace Name Mixin selector official dLpb;d(Ljava/lang/String;)Vintermediary method_11024Lnet/minecraft/class_2588;method_11024(Ljava/lang/String;)Vnamed setTranslationLnet/minecraft/text/TranslatableText;setTranslation(Ljava/lang/String;)V
-
getArg
private StringVisitable getArg(int index)
- Mappings:
Namespace Name Mixin selector official bLpb;b(I)Loq;intermediary method_29434Lnet/minecraft/class_2588;method_29434(I)Lnet/minecraft/class_5348;named getArgLnet/minecraft/text/TranslatableText;getArg(I)Lnet/minecraft/text/StringVisitable;
-
copy
public TranslatableText copy()
从接口复制的说明:TextCopies the text itself, excluding the styles or siblings.
-
visitSelf
public <T> Optional<T> visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)
Visits the text itself.- 指定者:
visitSelf在接口中Text- 参数:
visitor- the visitorstyle- the current style- 返回:
- the visitor's return value
- 另请参阅:
Text.visit(StyledVisitor, Style)- Mappings:
Namespace Name Mixin selector official bLon;b(Loq$b;Lox;)Ljava/util/Optional;intermediary method_27660Lnet/minecraft/class_2561;method_27660(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;named visitSelfLnet/minecraft/text/Text;visitSelf(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
-
visitSelf
public <T> Optional<T> visitSelf(StringVisitable.Visitor<T> visitor)
Visits the text itself.- 指定者:
visitSelf在接口中Text- 参数:
visitor- the visitor- 返回:
- the visitor's return value
- 另请参阅:
Text.visit(Visitor)- Mappings:
Namespace Name Mixin selector official bLon;b(Loq$a;)Ljava/util/Optional;intermediary method_27659Lnet/minecraft/class_2561;method_27659(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;named visitSelfLnet/minecraft/text/Text;visitSelf(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
-
parse
public MutableText parse(@Nullable @Nullable ServerCommandSource source, @Nullable @Nullable Entity sender, int depth) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- 指定者:
parse在接口中ParsableText- 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official aLop;a(Ldg;Lasl;I)Lot;intermediary method_10890Lnet/minecraft/class_2566;method_10890(Lnet/minecraft/class_2168;Lnet/minecraft/class_1297;I)Lnet/minecraft/class_5250;named parseLnet/minecraft/text/ParsableText;parse(Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/entity/Entity;I)Lnet/minecraft/text/MutableText;
-
equals
public boolean equals(Object obj)
-
hashCode
public int hashCode()
-
toString
public String toString()
-
getKey
public String getKey()
- Mappings:
Namespace Name Mixin selector official iLpb;i()Ljava/lang/String;intermediary method_11022Lnet/minecraft/class_2588;method_11022()Ljava/lang/String;named getKeyLnet/minecraft/text/TranslatableText;getKey()Ljava/lang/String;
-
getArgs
public Object[] getArgs()
- Mappings:
Namespace Name Mixin selector official jLpb;j()[Ljava/lang/Object;intermediary method_11023Lnet/minecraft/class_2588;method_11023()[Ljava/lang/Object;named getArgsLnet/minecraft/text/TranslatableText;getArgs()[Ljava/lang/Object;
-
-