Class RichDescription

java.lang.Object
cloud.commandframework.minecraft.extras.RichDescription
All Implemented Interfaces:
cloud.commandframework.ArgumentDescription

public final class RichDescription extends Object implements cloud.commandframework.ArgumentDescription
An argument description implementation that uses Adventure components.
Since:
1.4.0
  • Method Details

    • empty

      public static @NonNull RichDescription empty()
      Get an empty description.
      Returns:
      the empty description
    • of

      public static @NonNull RichDescription of(@NonNull net.kyori.adventure.text.ComponentLike contents)
      Create a new rich description from the provided component.
      Parameters:
      contents - the rich contents
      Returns:
      a new rich description
    • translatable

      public static @NonNull RichDescription translatable(@NonNull String key)
      Create a rich description pointing to a translation key.
      Parameters:
      key - the translation key
      Returns:
      a new rich description
    • translatable

      public static @NonNull RichDescription translatable(@NonNull String key, @NonNull net.kyori.adventure.text.ComponentLike @NonNull ... args)
      Create a rich description pointing to a translation key.
      Parameters:
      key - the translation key
      args - the arguments to use with the translation key
      Returns:
      a new rich description
    • getDescription

      @Deprecated public @NonNull String getDescription()
      Deprecated.
      to discourage use. A plain serialization is a somewhat expensive and lossy operation, use getContents() instead.
      Specified by:
      getDescription in interface cloud.commandframework.ArgumentDescription
    • getContents

      public @NonNull net.kyori.adventure.text.Component getContents()
      Get the contents of this description.
      Returns:
      the component contents of this description
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface cloud.commandframework.ArgumentDescription