Search in sources :

Example 1 with IntersectBiomesPackage

use of me.superckl.api.biometweaker.script.pack.IntersectBiomesPackage in project BiomeTweaker by superckl.

the class IntersectPackParameterWrapper method parseArgs.

@Override
public Pair<IntersectBiomesPackage[], String[]> parseArgs(final ScriptHandler handler, final String... args) throws Exception {
    final List<BiomePackage> parsed = new ArrayList<>();
    String[] toReturn = new String[0];
    for (int i = 0; i < args.length; i++) {
        final BiomePackage obj = BTParameterTypes.BASIC_BIOMES_PACKAGE.tryParse(args[i], handler);
        if (obj == null) {
            toReturn = new String[args.length - i];
            System.arraycopy(args, i, toReturn, 0, toReturn.length);
            break;
        }
        parsed.add(obj);
    }
    return Pair.of(new IntersectBiomesPackage[] { new IntersectBiomesPackage(parsed.toArray(new BiomePackage[parsed.size()])) }, toReturn);
}
Also used : ArrayList(java.util.ArrayList) IntersectBiomesPackage(me.superckl.api.biometweaker.script.pack.IntersectBiomesPackage) BiomePackage(me.superckl.api.biometweaker.script.pack.BiomePackage)

Aggregations

ArrayList (java.util.ArrayList)1 BiomePackage (me.superckl.api.biometweaker.script.pack.BiomePackage)1 IntersectBiomesPackage (me.superckl.api.biometweaker.script.pack.IntersectBiomesPackage)1