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,StringRenderable,Text
public class TranslatableText extends BaseText implements ParsableText
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.text.StringRenderable
StringRenderable.StyledVisitor<T>, StringRenderable.Visitor<T> -
Field Summary
Fields Modifier and Type Field Description private static PatternARG_FORMATprivate Object[]argsprivate static Object[]EMPTY_ARGUMENTSprivate Stringkeyprivate LanguagelanguageCacheprivate static StringRenderableLITERAL_PERCENT_SIGNprivate static StringRenderableNULL_ARGUMENTprivate List<StringRenderable>translations -
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)Object[]getArgs()StringgetKey()inthashCode()private StringRenderablemethod_29434(int int2, Language language)MutableTextparse(ServerCommandSource source, Entity sender, int depth)private voidsetTranslation(String translation, Language language)StringtoString()private voidupdateTranslations()<T> Optional<T>visitSelf(StringRenderable.StyledVisitor<T> visitor, Style style)Visits the text itself.<T> Optional<T>visitSelf(StringRenderable.Visitor<T> visitor)Visits the text itself.Methods inherited from class net.minecraft.text.BaseText
append, asString, getSiblings, getStyle, setStyle, shallowCopyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
Constructor Details
-
Method Details
-
updateTranslations
private void updateTranslations() -
setTranslation
-
method_29434
-
copy
Description copied from interface:TextCopies the text itself, excluding the styles or siblings. -
visitSelf
@Environment(CLIENT) public <T> Optional<T> visitSelf(StringRenderable.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
-