Package com.sk89q.worldedit.util.command.parametric

Examples of com.sk89q.worldedit.util.command.parametric.ParameterException


            if (actor instanceof Entity) {
                Extent extent = ((Entity) actor).getExtent();
                if (extent instanceof World) {
                    world = (World) extent;
                } else {
                    throw new ParameterException("A world is required.");
                }
            } else {
                throw new ParameterException("An entity is required.");
            }

            BiomeRegistry biomeRegistry = world.getWorldData().getBiomeRegistry();
            List<BaseBiome> knownBiomes = biomeRegistry.getBiomes();
            BaseBiome biome = Biomes.findBiomeByName(knownBiomes, input, biomeRegistry);
            if (biome != null) {
                return biome;
            } else {
                throw new ParameterException(
                        String.format("Can't recognize biome type '%s' -- use /biomelist to list available types", input));
            }
        } else {
            throw new ParameterException(
                    "This command takes a 'default' biome if one is not set, except there is no particular " +
                            "biome that should be 'default', so the command should not be taking a default biome");
        }
    }
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.util.command.parametric.ParameterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.