public final class TranslatableComponent extends BaseComponent
| Constructor and Description |
|---|
TranslatableComponent() |
TranslatableComponent(String translate,
Object... with)
Creates a translatable component with the passed substitutions
|
TranslatableComponent(TranslatableComponent original)
Creates a translatable component from the original to clone it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addWith(BaseComponent component)
Adds a component substitution to the component.
|
void |
addWith(String text)
Adds a text substitution to the component.
|
BaseComponent |
duplicate()
Creates a duplicate of this TranslatableComponent.
|
Pattern |
getFormat() |
String |
getTranslate()
The key into the Minecraft locale files to use for the translation.
|
List<BaseComponent> |
getWith()
The components to substitute into the translation
|
void |
setTranslate(String translate)
The key into the Minecraft locale files to use for the translation.
|
void |
setWith(List<BaseComponent> components)
Sets the translation substitutions to be used in this component.
|
protected void |
toLegacyText(StringBuilder builder) |
protected void |
toPlainText(StringBuilder builder) |
String |
toString() |
addExtra, addExtra, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getClickEvent, getColor, getColorRaw, getExtra, getHoverEvent, getInsertion, hasFormatting, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setBold, setClickEvent, setColor, setExtra, setHoverEvent, setInsertion, setItalic, setObfuscated, setStrikethrough, setUnderlined, toLegacyText, toLegacyText, toPlainText, toPlainTextpublic TranslatableComponent(TranslatableComponent original)
original - the original for the new translatable component.public TranslatableComponent(String translate, Object... with)
translate - the translation keywith - the Strings and
BaseComponents to use into the
translationtranslate,
setWith(java.util.List)public TranslatableComponent()
public BaseComponent duplicate()
duplicate in class BaseComponentpublic void setWith(List<BaseComponent> components)
components - the components to substitutepublic void addWith(String text)
text - the text to substitutepublic void addWith(BaseComponent component)
component - the component to substituteprotected void toPlainText(StringBuilder builder)
protected void toLegacyText(StringBuilder builder)
public Pattern getFormat()
public String getTranslate()
public List<BaseComponent> getWith()
public void setTranslate(String translate)
public String toString()
toString in class BaseComponentCopyright © 2015–2019 WaterfallMC. All rights reserved.