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.
|
protected boolean |
canEqual(Object other) |
TranslatableComponent |
duplicate()
Creates a duplicate of this TranslatableComponent.
|
boolean |
equals(Object o) |
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
|
int |
hashCode() |
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, getFont, getFontRaw, getHoverEvent, getInsertion, hasFormatting, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setBold, setClickEvent, setColor, setExtra, setFont, setHoverEvent, setInsertion, setItalic, setObfuscated, setStrikethrough, setUnderlined, 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()
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)
public Pattern getFormat()
public String getTranslate()
public List<BaseComponent> getWith()
public void setTranslate(String translate)
public String toString()
toString
in class BaseComponent
public boolean equals(Object o)
equals
in class BaseComponent
protected boolean canEqual(Object other)
canEqual
in class BaseComponent
public int hashCode()
hashCode
in class BaseComponent
Copyright © 2012–2020 SpigotMC. All rights reserved.