Package net.aufdemrand.denizencore.exceptions

Examples of net.aufdemrand.denizencore.exceptions.CommandExecutionException


        switch (action) {

            case ASSUME:
                if (!poses.hasPose(id))
                    throw new CommandExecutionException("Pose \"" + id + "\" doesn't exist for " + npc.toString());

                if (target.name().equals("NPC"))
                    poses.assumePose(id);
                else {
                    Player player = ((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getPlayerEntity();
                    Location location = player.getLocation();
                    location.setYaw(poses.getPose(id).getYaw());
                    location.setPitch(poses.getPose(id).getPitch());

                    // The only way to change a player's yaw and pitch in Bukkit
                    // is to use teleport on him/her
                    player.teleport(location);
                }
                break;

            case ADD:
                if (!poses.addPose(id, pose_loc))
                    throw new CommandExecutionException(npc.toString() + " already has that pose!");
                break;

            case REMOVE:
                if (!poses.removePose(id))
                    throw new CommandExecutionException(npc.toString() + " does not have that pose!");
                break;

        }

    }
View Full Code Here


            flag = DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag((dPlayer) flag_target, name.asString());

        else if (flag_target instanceof dNPC)
            flag = DenizenAPI.getCurrentInstance().flagManager().getNPCFlag(((dNPC) flag_target).getId(), name.asString());

        else throw new CommandExecutionException("Could not fetch a flag for this entity: " + flag_target.debug());

        // Do the action!
        flag.doAction(action, value, index);

        // Set flag duration
View Full Code Here

            dObject fetched;

        // Check to make sure this is a valid constructor by checking the 'matches' static method
            if (!ObjectFetcher.checkMatch(object_class, object))
                throw new CommandExecutionException('\'' + object + "' is returning null.");

            // Get the object with the 'valueOf' static method
            fetched = ObjectFetcher.getObjectFrom(object_class, object);

            // Make sure this object is Adjustable
View Full Code Here

            scriptEntry.addObject("created_map", new Element(map.getId()));
        }
        else if (id != null) {
            map = Bukkit.getServer().getMap((short) id.asInt());
            if (map == null)
                throw new CommandExecutionException("No map found for ID '" + id.asInt() + "'!");
        }
        else {
            throw new CommandExecutionException("The map command failed somehow! Report this to a developer!");
        }

        if (reset != null) {
            for (MapRenderer renderer : map.getRenderers()) {
                if (renderer instanceof DenizenMapRenderer) {
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizencore.exceptions.CommandExecutionException

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.