类 TextComponent
java.lang.Object
net.md_5.bungee.api.chat.BaseComponent
net.md_5.bungee.api.chat.TextComponent
-
嵌套类概要
从类继承的嵌套类/接口 net.md_5.bungee.api.chat.BaseComponent
BaseComponent.LimitedStringVisitor, BaseComponent.StringVisitor
-
构造器概要
构造器构造器说明Creates a TextComponent with blank text.TextComponent
(BaseComponent... extras) Creates a TextComponent with blank text and the extras set to the passed arrayTextComponent
(TextComponent textComponent) Creates a TextComponent with formatting and text from the passed component -
方法概要
修饰符和类型方法说明Creates a duplicate of this TextComponent.static BaseComponent
fromArray
(BaseComponent... components) Internal compatibility method to transform an array of components to a single component.static BaseComponent
fromLegacy
(String message) Converts the old formatting system that usedChatColor.COLOR_CHAR
into the new json based system.static BaseComponent
fromLegacy
(String message, ChatColor defaultColor) Converts the old formatting system that usedChatColor.COLOR_CHAR
into the new json based system.static BaseComponent[]
fromLegacyText
(String message) 已过时。static BaseComponent[]
fromLegacyText
(String message, ChatColor defaultColor) 已过时。fromLegacy(String, ChatColor)
is preferred as it will consolidate all components into a single BaseComponent with extra contents as opposed to an array of components which is non-standard and may result in unexpected behavior.protected void
toLegacyText
(BaseComponent.StringVisitor builder) protected void
toPlainText
(BaseComponent.StringVisitor builder) toString()
从类继承的方法 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
-
构造器详细资料
-
TextComponent
public TextComponent()Creates a TextComponent with blank text. -
TextComponent
Creates a TextComponent with formatting and text from the passed component- 参数:
textComponent
- the component to copy from
-
TextComponent
Creates a TextComponent with blank text and the extras set to the passed array- 参数:
extras
- the extras to set
-
-
方法详细资料
-
fromLegacy
Converts the old formatting system that usedChatColor.COLOR_CHAR
into the new json based system.- 参数:
message
- the text to convert- 返回:
- the components needed to print the message to the client
-
fromLegacy
Converts the old formatting system that usedChatColor.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).- 返回:
- the components needed to print the message to the client
-
fromLegacyText
已过时。fromLegacy(String)
is preferred as it will consolidate all components into a single BaseComponent with extra contents as opposed to an array of components which is non-standard and may result in unexpected behavior.Converts the old formatting system that usedChatColor.COLOR_CHAR
into the new json based system.- 参数:
message
- the text to convert- 返回:
- the components needed to print the message to the client
-
fromLegacyText
已过时。fromLegacy(String, ChatColor)
is preferred as it will consolidate all components into a single BaseComponent with extra contents as opposed to an array of components which is non-standard and may result in unexpected behavior.Converts the old formatting system that usedChatColor.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).- 返回:
- the components needed to print the message to the client
-
fromArray
Internal compatibility method to transform an array of components to a single component.- 参数:
components
- array- 返回:
- single component
-
duplicate
Creates a duplicate of this TextComponent.- 指定者:
duplicate
在类中BaseComponent
- 返回:
- the duplicate of this TextComponent.
-
toPlainText
-
toLegacyText
-
toString
-
fromLegacy(String)
is preferred as it will consolidate all components into a single BaseComponent with extra contents as opposed to an array of components which is non-standard and may result in unexpected behavior.