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

# 类 TranslatableComponent

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

public final class TranslatableComponent extends BaseComponent

- ## 构造器概要

  构造器
  构造器
  说明
  `TranslatableComponent()`
  `TranslatableComponent(String translate, Object... with)`
  Creates a translatable component with the passed substitutions
  `TranslatableComponent(TranslatableComponent original)`
  Creates a translatable component from the original to clone it.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `void`
  `addWith(String text)`
  Adds a text substitution to the component.
  `void`
  `addWith(BaseComponent component)`
  Adds a component substitution to the component.
  `protected boolean`
  `canEqual(Object other)`
  `TranslatableComponent`
  `duplicate()`
  Creates a duplicate of this TranslatableComponent.
  `boolean`
  `equals(Object o)`
  `Pattern`
  `getFormat()`
  `String`
  `getTranslate()`
  The key into the Minecraft locale files to use for the translation.
  `List<BaseComponent>`
  `getWith()`
  The components to substitute into the translation
  `int`
  `hashCode()`
  `void`
  `setTranslate(String translate)`
  The key into the Minecraft locale files to use for the translation.
  `void`
  `setWith(List<BaseComponent> components)`
  Sets the translation substitutions to be used in this component.
  `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`

- ## 构造器详细资料

  - ### TranslatableComponent

    public TranslatableComponent(TranslatableComponent original)
    Creates a translatable component from the original to clone it.
    参数:
      `original` - the original for the new translatable component.

  - ### TranslatableComponent

    public TranslatableComponent(String translate, Object... with)
    Creates a translatable component with the passed substitutions
    参数:
      `translate` - the translation key
      `with` - the `String`s and `BaseComponent`s to use into the translation
    另请参阅:
      - `translate`
      - `setWith(java.util.List)`

  - ### TranslatableComponent

    public TranslatableComponent()

- ## 方法详细资料

  - ### duplicate

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

  - ### setWith

    public void setWith(List<BaseComponent> components)
    Sets the translation substitutions to be used in this component. Removes any previously set substitutions
    参数:
      `components` - the components to substitute

  - ### addWith

    public void addWith(String text)
    Adds a text substitution to the component. The text will inherit this component's formatting
    参数:
      `text` - the text to substitute

  - ### addWith

    public void addWith(BaseComponent component)
    Adds a component substitution to the component. The text will inherit this component's formatting
    参数:
      `component` - the component to substitute

  - ### toPlainText

    protected void toPlainText(StringBuilder builder)

  - ### toLegacyText

    protected void toLegacyText(StringBuilder builder)

  - ### getFormat

    public Pattern getFormat()

  - ### getTranslate

    public String getTranslate()
    The key into the Minecraft locale files to use for the translation. The text depends on the client's locale setting. The console is always en_US

  - ### getWith

    public List<BaseComponent> getWith()
    The components to substitute into the translation

  - ### setTranslate

    public void setTranslate(String translate)
    The key into the Minecraft locale files to use for the translation. The text depends on the client's locale setting. The console is always en_US

  - ### toString

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

  - ### equals

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

  - ### canEqual

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

  - ### hashCode

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