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 Summary
Modifier and TypeMethodDescriptionstatic @NonNull RichDescriptionempty()Get an empty description.@NonNull net.kyori.adventure.text.ComponentGet the contents of this description.@NonNull StringDeprecated.to discourage use.booleanisEmpty()static @NonNull RichDescriptionof(@NonNull net.kyori.adventure.text.ComponentLike contents) Create a new rich description from the provided component.static @NonNull RichDescriptiontranslatable(@NonNull String key) Create a rich description pointing to a translation key.static @NonNull RichDescriptiontranslatable(@NonNull String key, @NonNull net.kyori.adventure.text.ComponentLike @NonNull ... args) Create a rich description pointing to a translation key.
-
Method Details
-
empty
Get an empty description.- Returns:
- the empty description
-
of
Create a new rich description from the provided component.- Parameters:
contents- the rich contents- Returns:
- a new rich description
-
translatable
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 keyargs- the arguments to use with the translation key- Returns:
- a new rich description
-
getDescription
Deprecated.to discourage use. A plain serialization is a somewhat expensive and lossy operation, usegetContents()instead.- Specified by:
getDescriptionin interfacecloud.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:
isEmptyin interfacecloud.commandframework.ArgumentDescription
-