Package net.md_5.bungee.api.chat
Class TranslatableComponent
java.lang.Object
net.md_5.bungee.api.chat.BaseComponent
net.md_5.bungee.api.chat.TranslatableComponent
-
Constructor Summary
ConstructorsConstructorDescriptionTranslatableComponent
(String translate, Object... with) Creates a translatable component with the passed substitutionsTranslatableComponent
(TranslatableComponent original) Creates a translatable component from the original to clone it. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a text substitution to the component.void
addWith
(BaseComponent component) Adds a component substitution to the component.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) Methods inherited from class net.md_5.bungee.api.chat.BaseComponent
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
-
Constructor Details
-
TranslatableComponent
Creates a translatable component from the original to clone it.- Parameters:
original
- the original for the new translatable component.
-
TranslatableComponent
Creates a translatable component with the passed substitutions- Parameters:
translate
- the translation keywith
- theString
s andBaseComponent
s to use into the translation- See Also:
-
translate
setWith(java.util.List)
-
-
Method Details
-
duplicate
Creates a duplicate of this TranslatableComponent.- Specified by:
duplicate
in classBaseComponent
- Returns:
- the duplicate of this TranslatableComponent.
-
setWith
Sets the translation substitutions to be used in this component. Removes any previously set substitutions- Parameters:
components
- the components to substitute
-
addWith
Adds a text substitution to the component. The text will inherit this component's formatting- Parameters:
text
- the text to substitute
-
addWith
Adds a component substitution to the component. The text will inherit this component's formatting- Parameters:
component
- the component to substitute
-
toPlainText
-
toLegacyText
-