@@ -0,0 +1,2060 @@
+package org.cyclops.cyclopscore.command.argument;%0A%0Aimport com.mojang.brigadier.StringReader;%0Aimport com.mojang.brigadier.arguments.ArgumentType;%0Aimport com.mojang.brigadier.context.CommandContext;%0Aimport com.mojang.brigadier.exceptions.CommandSyntaxException;%0Aimport com.mojang.brigadier.exceptions.SimpleCommandExceptionType;%0Aimport com.mojang.brigadier.suggestion.Suggestions;%0Aimport com.mojang.brigadier.suggestion.SuggestionsBuilder;%0Aimport net.minecraft.command.CommandSource;%0Aimport net.minecraft.command.ISuggestionProvider;%0Aimport net.minecraft.util.text.StringTextComponent;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.Locale;%0Aimport java.util.concurrent.CompletableFuture;%0Aimport java.util.stream.Collectors;%0A%0A/**%0A * An argument type for a certain enum.%0A * @author rubensworks%0A */%0Apublic class ArgumentTypeEnum%3CT extends Enum%3CT%3E%3E implements ArgumentType%3CT%3E %7B%0A%0A    private final Class%3CT%3E enumClass;%0A%0A    public ArgumentTypeEnum(Class%3CT%3E enumClass) %7B%0A        this.enumClass = enumClass;%0A    %7D%0A%0A    @Override%0A    public T parse(StringReader reader) throws CommandSyntaxException %7B%0A        try %7B%0A            return Enum.valueOf(this.enumClass, reader.readString().toUpperCase(Locale.ENGLISH));%0A        %7D catch (IllegalArgumentException e) %7B%0A            throw new SimpleCommandExceptionType(new StringTextComponent(%22Unknown value%22)).create();%0A        %7D%0A    %7D%0A%0A    @Override%0A    public Collection%3CString%3E getExamples() %7B%0A        return Arrays.stream(this.enumClass.getEnumConstants())%0A                .map(Enum::name)%0A                .map(name -%3E name.toLowerCase(Locale.ENGLISH))%0A                .collect(Collectors.toList());%0A    %7D%0A%0A    @Override%0A    public %3CS%3E CompletableFuture%3CSuggestions%3E listSuggestions(CommandContext%3CS%3E context, SuggestionsBuilder builder) %7B%0A        return ISuggestionProvider.suggest(getExamples(), builder);%0A    %7D%0A%0A    public static %3CT extends Enum%3CT%3E%3E T getValue(CommandContext%3CCommandSource%3E context, String name, Class%3CT%3E enumClass) %7B%0A        return context.getArgument(name, enumClass);%0A    %7D%0A%0A%7D%0A

Add enum argument type for commands