类 BaseComponent
java.lang.Object
net.md_5.bungee.api.chat.BaseComponent
-
嵌套类概要
嵌套类修饰符和类型类说明protected static classprotected static interface -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidAppends a text element to the component.voidaddExtra(BaseComponent component) Appends a component to the component.voidapplyStyle(ComponentStyle style) Apply the style from the givenComponentStyleto this component.voidcopyFormatting(BaseComponent component) Copies the events and formatting of a BaseComponent.voidcopyFormatting(BaseComponent component, boolean replace) Copies the events and formatting of a BaseComponent.voidcopyFormatting(BaseComponent component, ComponentBuilder.FormatRetention retention, boolean replace) Copies the specified formatting of a BaseComponent.abstract BaseComponentClones the BaseComponent and returns the clone.已过时。API use discouraged, use traditional duplicategetColor()Returns the color of this component.Returns the color of this component without checking the parents color.getFont()Returns the font of this component.Returns the font of this component without checking the parents font.Returns the shadow color of this component.Returns the shadow color of this component without checking the parents shadow color.booleanReturns whether the component has any formatting or events applied to itbooleanhasStyle()Returns whether the component has any styling applied to it.booleanisBold()Returns whether this component is bold.Returns whether this component is bold without checking the parents setting.booleanisItalic()Returns whether this component is italic.Returns whether this component is italic without checking the parents setting.booleanReturns whether this component is obfuscated.Returns whether this component is obfuscated without checking the parents setting.booleanReturns whether this component is strikethrough.Returns whether this component is strikethrough without checking the parents setting.booleanReturns whether this component is underlined.Returns whether this component is underlined without checking the parents setting.voidretain(ComponentBuilder.FormatRetention retention) Retains only the specified formatting.voidSet whether or not this component is bold.voidSet this component's color.voidsetExtra(List<BaseComponent> components) voidSet this component's font.voidSet whether or not this component is italic.voidsetObfuscated(Boolean obfuscated) Set whether or not this component is obfuscated.voidsetShadowColor(Color color) Set this component's shadow color.voidsetStrikethrough(Boolean strikethrough) Set whether or not this component is strikethrough.voidsetStyle(ComponentStyle style) Set theComponentStylefor this component.voidsetUnderlined(Boolean underlined) Set whether or not this component is underlined.Converts the component to a string that uses the old formatting codes (ChatColor.COLOR_CHARstatic StringtoLegacyText(BaseComponent... components) Converts the components to a string that uses the old formatting codes (ChatColor.COLOR_CHARConverts the component into a string without any formattingstatic StringtoPlainText(BaseComponent... components) Converts the components into a string without any formatting
-
构造器详细资料
-
BaseComponent
已过时。for use by internal classes only, will be removed.Default constructor.
-
-
方法详细资料
-
copyFormatting
Copies the events and formatting of a BaseComponent. Already set formatting will be replaced.- 参数:
component- the component to copy from
-
copyFormatting
Copies the events and formatting of a BaseComponent.- 参数:
component- the component to copy fromreplace- if already set formatting should be replaced by the new component
-
copyFormatting
public void copyFormatting(BaseComponent component, ComponentBuilder.FormatRetention retention, boolean replace) Copies the specified formatting of a BaseComponent.- 参数:
component- the component to copy fromretention- the formatting to copyreplace- if already set formatting should be replaced by the new component
-
retain
Retains only the specified formatting.- 参数:
retention- the formatting to retain
-
duplicate
Clones the BaseComponent and returns the clone.- 返回:
- The duplicate of this BaseComponent
-
duplicateWithoutFormatting
已过时。API use discouraged, use traditional duplicateClones the BaseComponent without formatting and returns the clone.- 返回:
- The duplicate of this BaseComponent
-
toLegacyText
Converts the components to a string that uses the old formatting codes (ChatColor.COLOR_CHAR- 参数:
components- the components to convert- 返回:
- the string in the old format
-
toPlainText
Converts the components into a string without any formatting- 参数:
components- the components to convert- 返回:
- the string as plain text
-
setStyle
Set theComponentStylefor this component.Unlike
applyStyle(ComponentStyle), this method will overwrite all style values on this component.- 参数:
style- the style to set, or null to set all style values to default
-
setColor
Set this component's color.Warning: This should be a color, not formatting code (ie,
ChatColor.colorshould not be null).- 参数:
color- the component color, or null to use the default
-
getColor
Returns the color of this component. This uses the parent's color if this component doesn't have one.ChatColor.WHITEis returned if no color is found.- 返回:
- the color of this component
-
getColorRaw
Returns the color of this component without checking the parents color. May return null- 返回:
- the color of this component
-
setShadowColor
Set this component's shadow color.- 参数:
color- the component shadow color, or null to use the default
-
getShadowColor
Returns the shadow color of this component. This uses the parent's shadow color if this component doesn't have one. null is returned if no shadow color is found.- 返回:
- the shadow color of this component
-
getShadowColorRaw
Returns the shadow color of this component without checking the parents shadow color. May return null- 返回:
- the shadow color of this component
-
setFont
Set this component's font.- 参数:
font- the font to set, or null to use the default
-
getFont
Returns the font of this component. This uses the parent's font if this component doesn't have one.- 返回:
- the font of this component, or null if default font
-
getFontRaw
Returns the font of this component without checking the parents font. May return null- 返回:
- the font of this component
-
setBold
Set whether or not this component is bold.- 参数:
bold- the new bold state, or null to use the default
-
isBold
public boolean isBold()Returns whether this component is bold. This uses the parent's setting if this component hasn't been set. false is returned if none of the parent chain has been set.- 返回:
- whether the component is bold
-
isBoldRaw
Returns whether this component is bold without checking the parents setting. May return null- 返回:
- whether the component is bold
-
setItalic
Set whether or not this component is italic.- 参数:
italic- the new italic state, or null to use the default
-
isItalic
public boolean isItalic()Returns whether this component is italic. This uses the parent's setting if this component hasn't been set. false is returned if none of the parent chain has been set.- 返回:
- whether the component is italic
-
isItalicRaw
Returns whether this component is italic without checking the parents setting. May return null- 返回:
- whether the component is italic
-
setUnderlined
Set whether or not this component is underlined.- 参数:
underlined- the new underlined state, or null to use the default
-
isUnderlined
public boolean isUnderlined()Returns whether this component is underlined. This uses the parent's setting if this component hasn't been set. false is returned if none of the parent chain has been set.- 返回:
- whether the component is underlined
-
isUnderlinedRaw
Returns whether this component is underlined without checking the parents setting. May return null- 返回:
- whether the component is underlined
-
setStrikethrough
Set whether or not this component is strikethrough.- 参数:
strikethrough- the new strikethrough state, or null to use the default
-
isStrikethrough
public boolean isStrikethrough()Returns whether this component is strikethrough. This uses the parent's setting if this component hasn't been set. false is returned if none of the parent chain has been set.- 返回:
- whether the component is strikethrough
-
isStrikethroughRaw
Returns whether this component is strikethrough without checking the parents setting. May return null- 返回:
- whether the component is strikethrough
-
setObfuscated
Set whether or not this component is obfuscated.- 参数:
obfuscated- the new obfuscated state, or null to use the default
-
isObfuscated
public boolean isObfuscated()Returns whether this component is obfuscated. This uses the parent's setting if this component hasn't been set. false is returned if none of the parent chain has been set.- 返回:
- whether the component is obfuscated
-
isObfuscatedRaw
Returns whether this component is obfuscated without checking the parents setting. May return null- 返回:
- whether the component is obfuscated
-
applyStyle
Apply the style from the givenComponentStyleto this component.Any style values that have been explicitly set in the style will be applied to this component. If a value is not set in the style, it will not override the style set in this component.
- 参数:
style- the style to apply
-
setExtra
-
addExtra
Appends a text element to the component. The text will inherit this component's formatting- 参数:
text- the text to append
-
addExtra
Appends a component to the component. The text will inherit this component's formatting- 参数:
component- the component to append
-
hasStyle
public boolean hasStyle()Returns whether the component has any styling applied to it.- 返回:
- Whether any styling is applied
-
hasFormatting
public boolean hasFormatting()Returns whether the component has any formatting or events applied to it- 返回:
- Whether any formatting or events are applied
-
toPlainText
Converts the component into a string without any formatting- 返回:
- the string as plain text
-
toLegacyText
Converts the component to a string that uses the old formatting codes (ChatColor.COLOR_CHAR- 返回:
- the string in the old format
-