public final class TranslatableComponent extends BaseComponent
Constructor and Description |
---|
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.
|
TranslatableComponent |
duplicate()
Creates a duplicate of this TranslatableComponent.
|
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) |
addExtra, addExtra, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getColor, getColorRaw, getFont, getFontRaw, hasFormatting, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setExtra, toLegacyText, toLegacyText, toPlainText, toPlainText
public TranslatableComponent(TranslatableComponent original)
original
- the original for the new translatable component.public TranslatableComponent(String translate, Object... with)
translate
- the translation keywith
- the String
s and
BaseComponent
s to use into the
translationtranslate
,
setWith(java.util.List)
public TranslatableComponent duplicate()
duplicate
in class BaseComponent
public 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)
Copyright © 2012–2020 SpigotMC. All rights reserved.