public class TranslationComponent extends TextComponent
| Constructor and Description |
|---|
TranslationComponent(java.lang.String key,
java.util.List<?> args) |
TranslationComponent(java.lang.String key,
java.lang.Object... args) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
asLegacyFormatString() |
java.lang.String |
asSingleString() |
TextComponent |
copy() |
java.lang.Object[] |
getArgs() |
java.lang.String |
getFallback() |
java.lang.String |
getKey() |
TextComponent |
resolveIntoComponents() |
TranslationComponent |
setArgs(java.lang.Object[] args)
Set the arguments of this component.
|
TranslationComponent |
setFallback(java.lang.String fallback)
Set the fallback of this component.
|
TranslationComponent |
setKey(java.lang.String key)
Set the key of this component.
|
TranslationComponent |
setTranslator(Translator translator)
Set the translator function used to translate the key.
|
TextComponent |
shallowCopy()
Create a shallow copy of this component.
|
java.lang.String |
toString() |
append, append, append, append, asUnformattedString, blockNbt, blockNbt, copyMetaTo, empty, entityNbt, entityNbt, forEach, formatted, getSiblings, getStyle, keybind, mergeSiblingParentStyle, of, of, of, of, score, score, selector, selector, setParentStyle, setSiblingParentStyle, setStyle, storageNbt, storageNbt, styled, translation, translationpublic TranslationComponent(java.lang.String key,
java.util.List<?> args)
public TranslationComponent(java.lang.String key,
java.lang.Object... args)
public java.lang.String getKey()
public TranslationComponent setKey(java.lang.String key)
key - The keypublic java.lang.Object[] getArgs()
public TranslationComponent setArgs(java.lang.Object[] args)
args - The arguments@Nullable public java.lang.String getFallback()
public TranslationComponent setFallback(@Nullable java.lang.String fallback)
fallback - The fallbackpublic TranslationComponent setTranslator(@Nullable Translator translator)
null. This is required for the fallback to work.translator - The translator functionpublic TextComponent resolveIntoComponents()
public java.lang.String asLegacyFormatString()
asLegacyFormatString in class TextComponentStringFormat.vanilla(char, boolean),
StringFormat.toString(TextComponent, ColorHandling, SerializerUnknownHandling)public java.lang.String asSingleString()
asSingleString in class TextComponentpublic TextComponent copy()
copy in interface net.lenni0451.mcstructs.core.Copyable<TextComponent>copy in class TextComponentpublic TextComponent shallowCopy()
TextComponentshallowCopy in class TextComponentpublic java.lang.String toString()
toString in class TextComponent