程序包 net.md_5.bungee.api.chat

# 类 TextComponent

java.lang.Object
net.md_5.bungee.api.chat.BaseComponent
net.md_5.bungee.api.chat.TextComponent

public final class TextComponent extends BaseComponent

- ## 构造器概要

  构造器
  构造器
  说明
  `TextComponent()`
  Creates a TextComponent with blank text.
  `TextComponent(String 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

- ## 方法概要

  修饰符和类型
  方法
  说明
  `protected boolean`
  `canEqual(Object other)`
  `TextComponent`
  `duplicate()`
  Creates a duplicate of this TextComponent.
  `boolean`
  `equals(Object o)`
  `static BaseComponent[]`
  `fromLegacyText(String message)`
  Converts the old formatting system that used `ChatColor.COLOR_CHAR` into the new json based system.
  `static BaseComponent[]`
  `fromLegacyText(String message, ChatColor defaultColor)`
  Converts the old formatting system that used `ChatColor.COLOR_CHAR` into the new json based system.
  `String`
  `getText()`
  The text of the component that will be displayed to the client
  `int`
  `hashCode()`
  `void`
  `setText(String text)`
  The text of the component that will be displayed to the client
  `protected void`
  `toLegacyText(StringBuilder builder)`
  `protected void`
  `toPlainText(StringBuilder builder)`
  `String`
  `toString()`

  ### 从类继承的方法 net.md_5.bungee.api.chat.BaseComponent

  `addExtra, addExtra, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getClickEvent, getColor, getColorRaw, getExtra, getFont, getFontRaw, getHoverEvent, getInsertion, hasFormatting, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setBold, setClickEvent, setColor, setExtra, setFont, setHoverEvent, setInsertion, setItalic, setObfuscated, setStrikethrough, setUnderlined, toLegacyText, toLegacyText, toPlainText, toPlainText`

  ### 从类继承的方法 java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 构造器详细资料

  - ### TextComponent

    public TextComponent()
    Creates a TextComponent with blank text.

  - ### TextComponent

    public TextComponent(TextComponent textComponent)
    Creates a TextComponent with formatting and text from the passed component
    参数:
      `textComponent` - the component to copy from

  - ### TextComponent

    public TextComponent(BaseComponent... extras)
    Creates a TextComponent with blank text and the extras set to the passed array
    参数:
      `extras` - the extras to set

  - ### TextComponent

    public TextComponent(String text)

- ## 方法详细资料

  - ### fromLegacyText

    public static BaseComponent[] fromLegacyText(String message)
    Converts the old formatting system that used `ChatColor.COLOR_CHAR` into the new json based system.
    参数:
      `message` - the text to convert
    返回:
      the components needed to print the message to the client

  - ### fromLegacyText

    public static BaseComponent[] fromLegacyText(String message, ChatColor defaultColor)
    Converts the old formatting system that used `ChatColor.COLOR_CHAR` into the new json based system.
    参数:
      `message` - the text to convert
      `defaultColor` - 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

  - ### duplicate

    public TextComponent duplicate()
    Creates a duplicate of this TextComponent.
    指定者:
      `duplicate` 在类中 `BaseComponent`
    返回:
      the duplicate of this TextComponent.

  - ### toPlainText

    protected void toPlainText(StringBuilder builder)

  - ### toLegacyText

    protected void toLegacyText(StringBuilder builder)

  - ### toString

    public String toString()
    覆盖:
      `toString` 在类中 `BaseComponent`

  - ### getText

    public String getText()
    The text of the component that will be displayed to the client

  - ### setText

    public void setText(String text)
    The text of the component that will be displayed to the client

  - ### equals

    public boolean equals(Object o)
    覆盖:
      `equals` 在类中 `BaseComponent`

  - ### canEqual

    protected boolean canEqual(Object other)
    覆盖:
      `canEqual` 在类中 `BaseComponent`

  - ### hashCode

    public int hashCode()
    覆盖:
      `hashCode` 在类中 `BaseComponent`