Package net.minecraft.text
Class TranslatableText
java.lang.Object
net.minecraft.text.BaseText
net.minecraft.text.TranslatableText
- All Implemented Interfaces:
com.mojang.brigadier.Message,MutableText,ParsableText,StringVisitable,Text
public class TranslatableText extends BaseText implements ParsableText
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.text.StringVisitable
StringVisitable.StyledVisitor<T>, StringVisitable.Visitor<T>Nested classes/interfaces inherited from interface net.minecraft.text.Text
Text.Serializer -
Field Summary
Fields Modifier and Type Field Description private static PatternARG_FORMATprivate Object[]argsprivate static Object[]EMPTY_ARGUMENTSprivate Stringkeyprivate LanguagelanguageCacheprivate static StringVisitableLITERAL_PERCENT_SIGNprivate static StringVisitableNULL_ARGUMENTprivate List<StringVisitable>translationsFields inherited from interface net.minecraft.text.StringVisitable
EMPTY, TERMINATE_VISIT -
Constructor Summary
Constructors Constructor Description TranslatableText(String key)TranslatableText(String key, Object[] args) -
Method Summary
Modifier and Type Method Description TranslatableTextcopy()Copies the text itself, excluding the styles or siblings.booleanequals(Object obj)private StringVisitablegetArg(int index)Object[]getArgs()StringgetKey()inthashCode()MutableTextparse(ServerCommandSource source, 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.Methods inherited from class net.minecraft.text.BaseText
append, asOrderedText, asString, getSiblings, getStyle, setStyle, shallowCopyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.text.MutableText
append, fillStyle, formatted, formatted, styledMethods inherited from interface net.minecraft.text.Text
asTruncatedString, getString, visit, visit
-
Field Details
-
EMPTY_ARGUMENTS
-
LITERAL_PERCENT_SIGN
-
NULL_ARGUMENT
-
ARG_FORMAT
-
key
-
args
-
languageCache
-
translations
-
-
Constructor Details
-
TranslatableText
-
TranslatableText
-
-
Method Details
-
updateTranslations
private void updateTranslations() -
setTranslation
-
getArg
-
copy
Description copied from interface:TextCopies the text itself, excluding the styles or siblings. -
visitSelf
@Environment(CLIENT) public <T> Optional<T> visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)Visits the text itself.- Specified by:
visitSelfin interfaceText- Parameters:
visitor- the visitorstyle- the current style- Returns:
- the visitor's return value
- See Also:
Text.visit(StyledVisitor, Style)
-
visitSelf
Visits the text itself.- Specified by:
visitSelfin interfaceText- Parameters:
visitor- the visitor- Returns:
- the visitor's return value
- See Also:
Text.visit(Visitor)
-
parse
public MutableText parse(@Nullable ServerCommandSource source, @Nullable Entity sender, int depth) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Specified by:
parsein interfaceParsableText- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
equals
-
hashCode
public int hashCode() -
toString
-
getKey
-
getArgs
-