Interface DescriptionFacade


@Immutable public interface DescriptionFacade
A general interface for dealing with command and command element descriptions.
  • Field Details

  • Method Details

    • text

      static DescriptionFacade text(String text)
      Creates a text description, which is just a simple string.
      Parameters:
      text - the text
      Returns:
      the created text description
    • translated

      static DescriptionFacade translated(String key, Locale defaultLocale)
      Creates a new translated description. It uses distributor global translation system to translate the given key with either the input locale or the default locale.
      Parameters:
      key - the translation key
      defaultLocale - the default locale
      Returns:
      the created translated description
    • getText

      String getText()
      Returns the description text.
    • getText

      default String getText(CommandSender sender)
      Returns the description text for the given command sender.
      Parameters:
      sender - the command sender
      Returns:
      the description text
    • getComponent

      default Component getComponent()
      Returns the description text as a Component.
    • getComponent

      default Component getComponent(CommandSender sender)
      Returns the description text as a Component for the given command sender.
      Parameters:
      sender - the command sender
      Returns:
      the description Component
    • isEmpty

      default boolean isEmpty()
      Returns whether this description is empty.
    • isEmpty

      default boolean isEmpty(CommandSender sender)
      Returns whether this description is empty for the given locale holder.
      Parameters:
      sender - the command sender
      Returns:
      whether this description is empty