Class RichDescription
java.lang.Object
org.incendo.cloud.minecraft.extras.RichDescription
- All Implemented Interfaces:
Description
A description implementation that uses Adventure components.
- Since:
- 1.4.0
-
Method Summary
Modifier and TypeMethodDescriptioncontents()Returns the contents of this description.static @NonNull RichDescriptionempty()Get an empty description.booleaninthashCode()booleanisEmpty()static @NonNull RichDescriptionof(@NonNull ComponentLike contents) Create a new rich description from the provided component.static @NonNull RichDescriptionrichDescription(@NonNull ComponentLike contents) Create a new rich description from the provided component.Deprecated.to discourage use.static @NonNull RichDescriptiontranslatable(@NonNull String key) Create a rich description pointing to a translation key.static @NonNull RichDescriptiontranslatable(@NonNull String key, @NonNull 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
-
richDescription
Create a new rich description from the provided component. Alias forof(ComponentLike).- 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 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
-
textDescription
Deprecated.to discourage use. A plain serialization is a somewhat expensive and lossy operation, usecontents()instead.- Specified by:
textDescriptionin interfaceDescription
-
contents
Returns the contents of this description.- Returns:
- the component contents of this description
- Since:
- 2.0.0
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceDescription
-
equals
-
hashCode
public int hashCode()
-