public abstract class BaseComponent extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addExtra(BaseComponent component)
Appends a component to the component.
|
void |
addExtra(String text)
Appends a text element to the component.
|
abstract BaseComponent |
duplicate()
Clones the BaseComponent and returns the clone.
|
ChatColor |
getColor()
Returns the color of this component.
|
ChatColor |
getColorRaw()
Returns the color of this component without checking the parents color.
|
boolean |
hasFormatting()
Returns whether the component has any formatting or events applied to it
|
boolean |
isBold()
Returns whether this component is bold.
|
Boolean |
isBoldRaw()
Returns whether this component is bold without checking the parents
setting.
|
boolean |
isItalic()
Returns whether this component is italic.
|
Boolean |
isItalicRaw()
Returns whether this component is italic without checking the parents
setting.
|
boolean |
isObfuscated()
Returns whether this component is obfuscated.
|
Boolean |
isObfuscatedRaw()
Returns whether this component is obfuscated without checking the parents
setting.
|
boolean |
isStrikethrough()
Returns whether this component is strikethrough.
|
Boolean |
isStrikethroughRaw()
Returns whether this component is strikethrough without checking the
parents setting.
|
boolean |
isUnderlined()
Returns whether this component is underlined.
|
Boolean |
isUnderlinedRaw()
Returns whether this component is underlined without checking the parents
setting.
|
void |
setExtra(List<BaseComponent> components) |
String |
toLegacyText()
Converts the component to a string that uses the old formatting codes
(
ChatColor.COLOR_CHAR |
static String |
toLegacyText(BaseComponent... components)
Converts the components to a string that uses the old formatting codes
(
ChatColor.COLOR_CHAR |
String |
toPlainText()
Converts the component into a string without any formatting
|
static String |
toPlainText(BaseComponent... components)
Converts the components into a string without any formatting
|
public abstract BaseComponent duplicate()
public static String toLegacyText(BaseComponent... components)
ChatColor.COLOR_CHARcomponents - the components to convertpublic static String toPlainText(BaseComponent... components)
components - the components to convertpublic ChatColor getColor()
ChatColor.WHITE
is returned if no color is found.public ChatColor getColorRaw()
public boolean isBold()
public Boolean isBoldRaw()
public boolean isItalic()
public Boolean isItalicRaw()
public boolean isUnderlined()
public Boolean isUnderlinedRaw()
public boolean isStrikethrough()
public Boolean isStrikethroughRaw()
public boolean isObfuscated()
public Boolean isObfuscatedRaw()
public void setExtra(List<BaseComponent> components)
public void addExtra(String text)
text - the text to appendpublic void addExtra(BaseComponent component)
component - the component to appendpublic boolean hasFormatting()
public String toPlainText()
public String toLegacyText()
ChatColor.COLOR_CHARCopyright © 2012-2016 SpigotMC. All Rights Reserved.