Package com.sk89q.minecraft.util.commands

Examples of com.sk89q.minecraft.util.commands.CommandException


    public void fromString(String str) throws CommandException {
        Type type = Type.findByPattern(str);
        if (type != null) {
            this.type = type;
        } else {
            throw new CommandException("Acceptable types: projectiles, items, paintings, itemframes, boats, minecarts, tnt, xp, or all");
        }
    }
View Full Code Here


        List<Countable<Integer>> distribution = null;
        List<Countable<BaseBlock>> distributionData = null;

        if (args.hasFlag('c')) {
            // TODO: Update for new clipboard
            throw new CommandException("Needs to be re-written again");
        } else {
            if (useData) {
                distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld()));
            } else {
                distribution = editSession.getBlockDistribution(session.getSelection(player.getWorld()));
View Full Code Here

        try {
            // Create parent directories
            File parent = f.getParentFile();
            if (parent != null && !parent.exists()) {
                if (!parent.mkdirs()) {
                    throw new CommandException("Could not create folder for schematics!");
                }
            }

            FileOutputStream fos = closer.register(new FileOutputStream(f));
            BufferedOutputStream bos = closer.register(new BufferedOutputStream(fos));
View Full Code Here

    @ExceptionMatch
    public void convert(NumberFormatException e) throws CommandException {
        final Matcher matcher = numberFormat.matcher(e.getMessage());

        if (matcher.matches()) {
            throw new CommandException("Number expected; string \"" + matcher.group(1)
                    + "\" given.");
        } else {
            throw new CommandException("Number expected; string given.");
        }
    }
View Full Code Here

        }
    }

    @ExceptionMatch
    public void convert(IncompleteRegionException e) throws CommandException {
        throw new CommandException("Make a region selection first.");
    }
View Full Code Here

        throw new CommandException("Make a region selection first.");
    }

    @ExceptionMatch
    public void convert(UnknownItemException e) throws CommandException {
        throw new CommandException("Block name '" + e.getID() + "' was not recognized.");
    }
View Full Code Here

        throw new CommandException("Block name '" + e.getID() + "' was not recognized.");
    }

    @ExceptionMatch
    public void convert(InvalidItemException e) throws CommandException {
        throw new CommandException(e.getMessage());
    }
View Full Code Here

        throw new CommandException(e.getMessage());
    }

    @ExceptionMatch
    public void convert(DisallowedItemException e) throws CommandException {
        throw new CommandException("Block '" + e.getID()
                + "' not allowed (see WorldEdit configuration).");
    }
View Full Code Here

                + "' not allowed (see WorldEdit configuration).");
    }

    @ExceptionMatch
    public void convert(MaxChangedBlocksException e) throws CommandException {
        throw new CommandException("Max blocks changed in an operation reached ("
                + e.getBlockLimit() + ").");
    }
View Full Code Here

                + e.getBlockLimit() + ").");
    }

    @ExceptionMatch
    public void convert(MaxBrushRadiusException e) throws CommandException {
        throw new CommandException("Maximum brush radius (in configuration): " + worldEdit.getConfiguration().maxBrushRadius);
    }
View Full Code Here

TOP

Related Classes of com.sk89q.minecraft.util.commands.CommandException

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.