Class TextColorArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,net.kyori.adventure.text.format.TextColor>
cloud.commandframework.minecraft.extras.TextColorArgument<C>
- Type Parameters:
C
- Command sender type
- All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<net.kyori.adventure.text.format.TextColor>
,Comparable<cloud.commandframework.arguments.CommandArgument<?,?>>
public final class TextColorArgument<C>
extends cloud.commandframework.arguments.CommandArgument<C,net.kyori.adventure.text.format.TextColor>
Parser for color codes.
Accepts NamedTextColors
, Legacy Minecraft & color codes, and Hex Codes (#RRGGBB or RRGGBB)
- Since:
- 1.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class cloud.commandframework.arguments.CommandArgument
cloud.commandframework.arguments.CommandArgument.Builder<C extends Object,T extends Object>, cloud.commandframework.arguments.CommandArgument.TypedBuilder<C extends Object,T extends Object,B extends cloud.commandframework.arguments.CommandArgument.Builder<C,T>>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull TextColorArgument<C>
Create a new required TextColor argumentstatic <C> @NonNull TextColorArgument<C>
Create a new optional TextColor argumentstatic <C> @NonNull TextColorArgument<C>
optionalWithDefault(@NonNull String name, @NonNull String defaultValue)
Create a new optional TextColor argumentMethods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultDescription, getDefaultValue, getKey, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
Method Details
-
of
Create a new required TextColor argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
Create a new optional TextColor argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optionalWithDefault
public static <C> @NonNull TextColorArgument<C> optionalWithDefault(@NonNull String name, @NonNull String defaultValue)Create a new optional TextColor argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument namedefaultValue
- Default value- Returns:
- Created argument
-