// Path: src/main/java/com/legobmw99/stormlight/util/Ideal.java
// public enum Ideal {
// 
//     TRAITOR,
//     UNINVESTED,
//     FIRST,
//     SECOND,
//     THIRD,
//     FOURTH,
//     FIFTH;
// 
//     public static Ideal get(int index) {
//         for (Ideal order : values()) {
//             if (order.getIndex() == index) {
//                 return order;
//             }
//         }
//         throw new IllegalArgumentException("Bad ideal index");
//     }
// 
//     public String getName() {
//         return name().toLowerCase(Locale.ROOT);
//     }
// 
//     public int getIndex() {
//         return ordinal() - 1;
//     }
// 
//     public Ideal progressIdeal() {
//         int i = getIndex() + 1;
//         if (i > 5) {
//             i = 5;
//         }
//         return get(i);
//     }
// 
//     public Ideal regressIdeal() {
//         int i = getIndex() - 1;
//         if (i < -1) {
//             i = -1;
//         }
//         return get(i);
//     }
// }
// 
// Path: src/main/java/com/legobmw99/stormlight/util/Order.java
// public enum Order {
//     WINDRUNNERS(ADHESION, GRAVITATION),
//     SKYBREAKERS(GRAVITATION, DIVISION),
//     DUSTBRINGERS(DIVISION, ABRASION),
//     EDGEDANCERS(ABRASION, PROGRESSION),
//     TRUTHWATCHERS(PROGRESSION, ILLUMINATION),
//     LIGHTWEAVERS(ILLUMINATION, TRANSFORMATION),
//     ELSECALLERS(TRANSFORMATION, TRANSPORTATION),
//     WILLSHAPERS(TRANSPORTATION, COHESION),
//     STONEWARDS(COHESION, TENSION),
//     BONDSMITHS(TENSION, ADHESION, FIFTH, SECOND, THIRD);
// 
// 
//     private final Surge first;
//     private final Surge second;
//     private final Ideal blade_gate;
//     private final Ideal first_gate;
//     private final Ideal second_gate;
// 
//     Order(Surge fst, Surge snd) {
//         this(fst, snd, FIRST, FIRST, FIRST);
//     }
// 
//     Order(Surge fst, Surge snd, Ideal blade, Ideal first, Ideal second) {
//         this.first = fst;
//         this.second = snd;
//         this.blade_gate = blade;
//         this.first_gate = first;
//         this.second_gate = second;
//     }
// 
//     public static Order getOrNull(int index) {
//         for (Order order : values()) {
//             if (order.getIndex() == index) {
//                 return order;
//             }
//         }
//         return null;
//     }
// 
//     public Surge getFirst() {
//         return first;
//     }
// 
//     public Surge getSecond() {
//         return second;
//     }
// 
//     public Ideal getFirstIdeal() {return first_gate;}
// 
//     public Ideal getSecondIdeal() {return second_gate;}
// 
//     public Ideal getBladeIdeal() {return blade_gate;}
// 
// 
//     public String getName() {
//         return name().toLowerCase(Locale.ROOT);
//     }
// 
//     public String getSingularName() {
//         String name = this.getName();
//         return name.substring(0, name.length() - 1);
//     }
// 
//     public int getIndex() {
//         return ordinal();
//     }
// 
//     public boolean hasSurge(Surge surge) {
//         return first == surge || second == surge;
//     }
// }


import com.legobmw99.stormlight.util.Ideal;
import com.legobmw99.stormlight.util.Order;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.network.chat.TranslatableComponent;
import java.util.Arrays;
import java.util.Collection;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
package com.legobmw99.stormlight.modules.powers.command;



public class StormlightArgType {

    public static class OrderType implements ArgumentType<Order> {

        public static final OrderType INSTANCE = new OrderType();
        private static final Set<String> types = Arrays.stream(Order.values()).map(Order::getName).collect(Collectors.toSet());
        private static final DynamicCommandExceptionType unknown_power = new DynamicCommandExceptionType(
                o -> new TranslatableComponent("commands.stormlight.unrecognized_order", o));

        @Override
        public Order parse(StringReader reader) throws CommandSyntaxException {
            String in = reader.readUnquotedString();
            if (types.contains(in)) {
                return Order.valueOf(in.toUpperCase(Locale.ROOT));
            }
            throw unknown_power.create(in);
        }

        @Override
        public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
            return SharedSuggestionProvider.suggest(types, builder).toCompletableFuture();
        }

        @Override
        public Collection<String> getExamples() {
            return types;
        }
    }

// Path: src/main/java/com/legobmw99/stormlight/util/Ideal.java
// public enum Ideal {
// 
//     TRAITOR,
//     UNINVESTED,
//     FIRST,
//     SECOND,
//     THIRD,
//     FOURTH,
//     FIFTH;
// 
//     public static Ideal get(int index) {
//         for (Ideal order : values()) {
//             if (order.getIndex() == index) {
//                 return order;
//             }
//         }
//         throw new IllegalArgumentException("Bad ideal index");
//     }
// 
//     public String getName() {
//         return name().toLowerCase(Locale.ROOT);
//     }
// 
//     public int getIndex() {
//         return ordinal() - 1;
//     }
// 
//     public Ideal progressIdeal() {
//         int i = getIndex() + 1;
//         if (i > 5) {
//             i = 5;
//         }
//         return get(i);
//     }
// 
//     public Ideal regressIdeal() {
//         int i = getIndex() - 1;
//         if (i < -1) {
//             i = -1;
//         }
//         return get(i);
//     }
// }
// 
// Path: src/main/java/com/legobmw99/stormlight/util/Order.java
// public enum Order {
//     WINDRUNNERS(ADHESION, GRAVITATION),
//     SKYBREAKERS(GRAVITATION, DIVISION),
//     DUSTBRINGERS(DIVISION, ABRASION),
//     EDGEDANCERS(ABRASION, PROGRESSION),
//     TRUTHWATCHERS(PROGRESSION, ILLUMINATION),
//     LIGHTWEAVERS(ILLUMINATION, TRANSFORMATION),
//     ELSECALLERS(TRANSFORMATION, TRANSPORTATION),
//     WILLSHAPERS(TRANSPORTATION, COHESION),
//     STONEWARDS(COHESION, TENSION),
//     BONDSMITHS(TENSION, ADHESION, FIFTH, SECOND, THIRD);
// 
// 
//     private final Surge first;
//     private final Surge second;
//     private final Ideal blade_gate;
//     private final Ideal first_gate;
//     private final Ideal second_gate;
// 
//     Order(Surge fst, Surge snd) {
//         this(fst, snd, FIRST, FIRST, FIRST);
//     }
// 
//     Order(Surge fst, Surge snd, Ideal blade, Ideal first, Ideal second) {
//         this.first = fst;
//         this.second = snd;
//         this.blade_gate = blade;
//         this.first_gate = first;
//         this.second_gate = second;
//     }
// 
//     public static Order getOrNull(int index) {
//         for (Order order : values()) {
//             if (order.getIndex() == index) {
//                 return order;
//             }
//         }
//         return null;
//     }
// 
//     public Surge getFirst() {
//         return first;
//     }
// 
//     public Surge getSecond() {
//         return second;
//     }
// 
//     public Ideal getFirstIdeal() {return first_gate;}
// 
//     public Ideal getSecondIdeal() {return second_gate;}
// 
//     public Ideal getBladeIdeal() {return blade_gate;}
// 
// 
//     public String getName() {
//         return name().toLowerCase(Locale.ROOT);
//     }
// 
//     public String getSingularName() {
//         String name = this.getName();
//         return name.substring(0, name.length() - 1);
//     }
// 
//     public int getIndex() {
//         return ordinal();
//     }
// 
//     public boolean hasSurge(Surge surge) {
//         return first == surge || second == surge;
//     }
// }


// Path: src/main/java/com/legobmw99/stormlight/modules/powers/command/StormlightArgType.java
import com.legobmw99.stormlight.util.Ideal;
import com.legobmw99.stormlight.util.Order;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.network.chat.TranslatableComponent;
import java.util.Arrays;
import java.util.Collection;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

package com.legobmw99.stormlight.modules.powers.command;



public class StormlightArgType {

    public static class OrderType implements ArgumentType<Order> {

        public static final OrderType INSTANCE = new OrderType();
        private static final Set<String> types = Arrays.stream(Order.values()).map(Order::getName).collect(Collectors.toSet());
        private static final DynamicCommandExceptionType unknown_power = new DynamicCommandExceptionType(
                o -> new TranslatableComponent("commands.stormlight.unrecognized_order", o));

        @Override
        public Order parse(StringReader reader) throws CommandSyntaxException {
            String in = reader.readUnquotedString();
            if (types.contains(in)) {
                return Order.valueOf(in.toUpperCase(Locale.ROOT));
            }
            throw unknown_power.create(in);
        }

        @Override
        public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
            return SharedSuggestionProvider.suggest(types, builder).toCompletableFuture();
        }

        @Override
        public Collection<String> getExamples() {
            return types;
        }
    }

    public static class IdealType implements ArgumentType<Ideal> {