public abstract class BaseComponent
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
addExtra(BaseComponent component)
Appends a component to the component.
|
void |
addExtra(java.lang.String text)
Appends a text element to the component.
|
void |
copyFormatting(BaseComponent component)
Copies the events and formatting of a BaseComponent.
|
void |
copyFormatting(BaseComponent component,
boolean replace)
Copies the events and formatting of a BaseComponent.
|
void |
copyFormatting(BaseComponent component,
ComponentBuilder.FormatRetention retention,
boolean replace)
Copies the specified formatting of a BaseComponent.
|
abstract BaseComponent |
duplicate()
Clones the BaseComponent and returns the clone.
|
BaseComponent |
duplicateWithoutFormatting()
Deprecated.
API use discouraged, use traditional duplicate
|
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.
|
java.lang.Boolean |
isBoldRaw()
Returns whether this component is bold without checking the parents
setting.
|
boolean |
isItalic()
Returns whether this component is italic.
|
java.lang.Boolean |
isItalicRaw()
Returns whether this component is italic without checking the parents
setting.
|
boolean |
isObfuscated()
Returns whether this component is obfuscated.
|
java.lang.Boolean |
isObfuscatedRaw()
Returns whether this component is obfuscated without checking the parents
setting.
|
boolean |
isStrikethrough()
Returns whether this component is strikethrough.
|
java.lang.Boolean |
isStrikethroughRaw()
Returns whether this component is strikethrough without checking the
parents setting.
|
boolean |
isUnderlined()
Returns whether this component is underlined.
|
java.lang.Boolean |
isUnderlinedRaw()
Returns whether this component is underlined without checking the parents
setting.
|
void |
retain(ComponentBuilder.FormatRetention retention)
Retains only the specified formatting.
|
void |
setExtra(java.util.List<BaseComponent> components) |
java.lang.String |
toLegacyText()
Converts the component to a string that uses the old formatting codes
(
ChatColor.COLOR_CHAR |
static java.lang.String |
toLegacyText(BaseComponent... components)
Converts the components to a string that uses the old formatting codes
(
ChatColor.COLOR_CHAR |
java.lang.String |
toPlainText()
Converts the component into a string without any formatting
|
static java.lang.String |
toPlainText(BaseComponent... components)
Converts the components into a string without any formatting
|
public void copyFormatting(BaseComponent component)
component - the component to copy frompublic void copyFormatting(BaseComponent component, boolean replace)
component - the component to copy fromreplace - if already set formatting should be replaced by the new
componentpublic void copyFormatting(BaseComponent component, ComponentBuilder.FormatRetention retention, boolean replace)
component - the component to copy fromretention - the formatting to copyreplace - if already set formatting should be replaced by the new
componentpublic void retain(ComponentBuilder.FormatRetention retention)
retention - the formatting to retainpublic abstract BaseComponent duplicate()
@Deprecated public BaseComponent duplicateWithoutFormatting()
public static java.lang.String toLegacyText(BaseComponent... components)
ChatColor.COLOR_CHARcomponents - the components to convertpublic static java.lang.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 java.lang.Boolean isBoldRaw()
public boolean isItalic()
public java.lang.Boolean isItalicRaw()
public boolean isUnderlined()
public java.lang.Boolean isUnderlinedRaw()
public boolean isStrikethrough()
public java.lang.Boolean isStrikethroughRaw()
public boolean isObfuscated()
public java.lang.Boolean isObfuscatedRaw()
public void setExtra(java.util.List<BaseComponent> components)
public void addExtra(java.lang.String text)
text - the text to appendpublic void addExtra(BaseComponent component)
component - the component to appendpublic boolean hasFormatting()
public java.lang.String toPlainText()
public java.lang.String toLegacyText()
ChatColor.COLOR_CHARCopyright © 2015-2018 WaterfallMC. All Rights Reserved.