Class EnumArgumentType<E extends Enum<E>>

java.lang.Object
dev.myriadclient.api.command.arguments.EnumArgumentType<E>
All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<E>

public class EnumArgumentType<E extends Enum<E>> extends Object implements com.mojang.brigadier.arguments.ArgumentType<E>
One of an enum's constants, typed in any case and with or without underscores (fast_place, FastPlace, fast-place); suggests them in lower case.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <E extends Enum<E>>
    E
    get(com.mojang.brigadier.context.CommandContext<?> ctx, String name, Class<E> type)
    The constant parsed for the argument name.
    <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
    listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
     
    static <E extends Enum<E>>
    EnumArgumentType<E>
    of(Class<E> type)
    An argument for one of type's constants.
    parse(com.mojang.brigadier.StringReader reader)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.mojang.brigadier.arguments.ArgumentType

    getExamples, parse
  • Method Details

    • of

      public static <E extends Enum<E>> EnumArgumentType<E> of(Class<E> type)
      An argument for one of type's constants.
    • get

      public static <E extends Enum<E>> E get(com.mojang.brigadier.context.CommandContext<?> ctx, String name, Class<E> type)
      The constant parsed for the argument name. Brigadier throws IllegalArgumentException if the command has no such argument.
    • parse

      public E parse(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Specified by:
      parse in interface com.mojang.brigadier.arguments.ArgumentType<E extends Enum<E>>
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • listSuggestions

      public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
      Specified by:
      listSuggestions in interface com.mojang.brigadier.arguments.ArgumentType<E extends Enum<E>>