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
    Modifier and Type
    Class
    Description
    static class 
     

    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 Type
    Method
    Description
    static <C> @NonNull TextColorArgument<C>
    of​(@NonNull String name)
    Create a new required TextColor argument
    static <C> @NonNull TextColorArgument<C>
    optional​(@NonNull String name)
    Create a new optional TextColor argument
    static <C> @NonNull TextColorArgument<C>
    optionalWithDefault​(@NonNull String name, @NonNull String defaultValue)
    Create a new optional TextColor argument

    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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • of

      public static <C> @NonNull TextColorArgument<C> of(@NonNull String name)
      Create a new required TextColor argument
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
    • optional

      public static <C> @NonNull TextColorArgument<C> optional(@NonNull String name)
      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 name
      defaultValue - Default value
      Returns:
      Created argument