public final class TextComponent extends BaseComponent
| Constructor and Description |
|---|
TextComponent()
Creates a TextComponent with blank text.
|
TextComponent(BaseComponent... extras)
Creates a TextComponent with blank text and the extras set to the passed
array
|
TextComponent(TextComponent textComponent)
Creates a TextComponent with formatting and text from the passed
component
|
| Modifier and Type | Method and Description |
|---|---|
BaseComponent |
duplicate()
Creates a duplicate of this TextComponent.
|
static BaseComponent[] |
fromLegacyText(java.lang.String message)
Converts the old formatting system that used
ChatColor.COLOR_CHAR into the new json based
system. |
static BaseComponent[] |
fromLegacyText(java.lang.String message,
ChatColor defaultColor)
Converts the old formatting system that used
ChatColor.COLOR_CHAR into the new json based
system. |
protected void |
toLegacyText(java.lang.StringBuilder builder) |
protected void |
toPlainText(java.lang.StringBuilder builder) |
java.lang.String |
toString() |
addExtra, addExtra, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getColor, getColorRaw, hasFormatting, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setExtra, toLegacyText, toLegacyText, toPlainText, toPlainTextpublic TextComponent()
public TextComponent(TextComponent textComponent)
textComponent - the component to copy frompublic TextComponent(BaseComponent... extras)
extras - the extras to setpublic static BaseComponent[] fromLegacyText(java.lang.String message)
ChatColor.COLOR_CHAR into the new json based
system.message - the text to convertpublic static BaseComponent[] fromLegacyText(java.lang.String message, ChatColor defaultColor)
ChatColor.COLOR_CHAR into the new json based
system.message - the text to convertdefaultColor - color to use when no formatting is to be applied
(i.e. after ChatColor.RESET).public BaseComponent duplicate()
duplicate in class BaseComponentprotected void toPlainText(java.lang.StringBuilder builder)
protected void toLegacyText(java.lang.StringBuilder builder)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2015-2018 WaterfallMC. All Rights Reserved.