接口 TextDisplay

所有超级接口:
CommandSender, Display, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, ServerOperator

public interface TextDisplay extends Display
表示文本显示实体。
  • 方法详细资料

    • getText

      获取显示的文本。
      返回:
      显示的文本。

      原文:Gets the displayed text.

    • setText

      void setText(@Nullable @Nullable String text)
      设置显示的文本。
      参数:
      text - 新文本

      原文:Sets the displayed text.

      text - the new text
    • getLineWidth

      int getLineWidth()
      获取换行前的最大行宽。
      返回:
      行宽

      原文:Gets the maximum line width before wrapping.

    • setLineWidth

      void setLineWidth(int width)
      设置换行前的最大行宽。
      参数:
      width - 新行宽

      原文:Sets the maximum line width before wrapping.

      width - new line width
    • getBackgroundColor

      @Nullable @Nullable Color getBackgroundColor()
      获取文本背景颜色。
      返回:
      背景颜色

      原文:Gets the text background color.

    • setBackgroundColor

      void setBackgroundColor(@Nullable @Nullable Color color)
      设置文本背景颜色。
      参数:
      color - 新背景颜色

      原文:Sets the text background color.

      color - new background color
    • getTextOpacity

      byte getTextOpacity()
      获取文本不透明度。
      返回:
      不透明度,如果未设置则返回-1

      原文:Gets the text opacity.

    • setTextOpacity

      void setTextOpacity(byte opacity)
      设置文本不透明度。
      参数:
      opacity - 新不透明度,如果为默认值则为-1

      原文:Sets the text opacity.

      opacity - new opacity or -1 if default
    • isShadowed

      boolean isShadowed()
      获取文本是否有阴影。
      返回:
      阴影状态

      原文:Gets if the text is shadowed.

    • setShadowed

      void setShadowed(boolean shadow)
      设置文本是否有阴影。
      参数:
      shadow - 是否有阴影

      原文:Sets if the text is shadowed.

      shadow - if shadowed
    • isSeeThrough

      boolean isSeeThrough()
      获取文本是否透明。
      返回:
      透明状态

      原文:Gets if the text is see through.

    • setSeeThrough

      void setSeeThrough(boolean seeThrough)
      设置文本是否透明。
      参数:
      seeThrough - 是否透明

      原文:Sets if the text is see through.

      seeThrough - if see through
    • isDefaultBackground

      boolean isDefaultBackground()
      获取文本是否有默认背景。
      返回:
      默认背景

      原文:Gets if the text has its default background.

    • setDefaultBackground

      void setDefaultBackground(boolean defaultBackground)
      设置文本是否有默认背景。
      参数:
      defaultBackground - 是否为默认

      原文:Sets if the text has its default background.

      defaultBackground - if default
    • getAlignment

      获取此显示的文本对齐方式。
      返回:
      文本对齐方式

      原文:Gets the text alignment for this display.

    • setAlignment

      void setAlignment(@NotNull @NotNull TextDisplay.TextAlignment alignment)
      设置此显示的文本对齐方式。
      参数:
      alignment - 新对齐方式

      原文:Sets the text alignment for this display.

      alignment - new alignment