Package org.moddingx.libx.command
Class EnumArgument2<T extends Enum<T>>
java.lang.Object
org.moddingx.libx.command.EnumArgument2<T>
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<T>
public class EnumArgument2<T extends Enum<T>>
extends Object
implements com.mojang.brigadier.arguments.ArgumentType<T>
As the
EnumArgument
is sometimes a bit buggy because when the entered value is
lowercase but the actual enum value is uppercase and it also does not sync properly, here's
a variant that solves these issues.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends Enum<R>>
EnumArgument2<R>enumArgument
(Class<R> enumClass) Creates a new enum argument for the given enum class.<S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
listSuggestions
(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) parse
(com.mojang.brigadier.StringReader reader)
-
Method Details
-
enumArgument
Creates a new enum argument for the given enum class. -
parse
public T parse(com.mojang.brigadier.StringReader reader) 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) -
getExamples
-