Class NamedColorArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,net.minecraft.ChatFormatting>
cloud.commandframework.fabric.argument.NamedColorArgument<C>
- Type Parameters:
C
- the sender type
- All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<net.minecraft.ChatFormatting>
,Comparable<cloud.commandframework.arguments.CommandArgument<?,
?>>
public final class NamedColorArgument<C>
extends cloud.commandframework.arguments.CommandArgument<C,net.minecraft.ChatFormatting>
An argument for named colors in the
ChatFormatting
enum.- Since:
- 1.5.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull NamedColorArgument.Builder<C>
Create a newNamedColorArgument.Builder
.static <C> @NonNull NamedColorArgument<C>
Create a new requiredNamedColorArgument
.static <C> @NonNull NamedColorArgument<C>
Create a new optionalNamedColorArgument
.static <C> @NonNull NamedColorArgument<C>
Create a new optionalNamedColorArgument
with the specified default value.Methods 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
-
builder
Create a newNamedColorArgument.Builder
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the component- Returns:
- Created builder
- Since:
- 1.5.0
-
of
Create a new requiredNamedColorArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component name- Returns:
- Created component
- Since:
- 1.5.0
-
optional
Create a new optionalNamedColorArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component name- Returns:
- Created component
- Since:
- 1.5.0
-
optional
public static <C> @NonNull NamedColorArgument<C> optional(@NonNull String name, @NonNull net.minecraft.ChatFormatting defaultColor) Create a new optionalNamedColorArgument
with the specified default value.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component namedefaultColor
- Default colour, must bea color
- Returns:
- Created component
- Since:
- 1.5.0
-