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
-
Nested Class Summary
Nested classes/interfaces inherited from class net.md_5.bungee.api.chat.BaseComponent
BaseComponent.LimitedStringVisitor, BaseComponent.StringVisitor -
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.TranslatableComponent(TranslationProvider translatable, Object... with) Creates a translatable component with the passed substitutions -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a text substitution to the component.voidaddWith(BaseComponent component) Adds a component substitution to the component.Creates a duplicate of this TranslatableComponent.voidsetWith(List<BaseComponent> components) Sets the translation substitutions to be used in this component.protected voidtoLegacyText(BaseComponent.StringVisitor builder) protected voidtoPlainText(BaseComponent.StringVisitor builder) Methods inherited from class net.md_5.bungee.api.chat.BaseComponent
addExtra, addExtra, applyStyle, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getColor, getColorRaw, getFont, getFontRaw, getShadowColor, getShadowColorRaw, hasFormatting, hasStyle, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setBold, setColor, setExtra, setFont, setItalic, setObfuscated, setShadowColor, setStrikethrough, setStyle, setUnderlined, 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- theStrings andBaseComponents to use into the translation- See Also:
-
TranslatableComponent
Creates a translatable component with the passed substitutions- Parameters:
translatable- the translatable objectwith- theStrings andBaseComponents to use into the translation- See Also:
-
-
Method Details
-
duplicate
Creates a duplicate of this TranslatableComponent.- Specified by:
duplicatein 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
-