Class EnumArgument<T extends Enum<T>>

java.lang.Object
net.neoforged.neoforge.server.command.EnumArgument<T>
All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<T>

public class EnumArgument<T extends Enum<T>> extends Object implements com.mojang.brigadier.arguments.ArgumentType<T>
  • Field Details

    • INVALID_ENUM

      private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType INVALID_ENUM
    • enumClass

      private final Class<T extends Enum<T>> enumClass
  • Constructor Details

    • EnumArgument

      private EnumArgument(Class<T> enumClass)
  • Method Details

    • enumArgument

      public static <R extends Enum<R>> EnumArgument<R> enumArgument(Class<R> enumClass)
    • parse

      public T parse(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Specified by:
      parse in interface com.mojang.brigadier.arguments.ArgumentType<T extends Enum<T>>
      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<T extends Enum<T>>
    • getExamples

      public Collection<String> getExamples()
      Specified by:
      getExamples in interface com.mojang.brigadier.arguments.ArgumentType<T extends Enum<T>>