Examples of CommandException


Examples of edu.isi.karma.controller.command.CommandException

    inputColumns.add(node.getHNodeId());
    outputColumns.add(node.getHNodeId());
    previousValue = node.getValue();
    previousStatus = node.getStatus();
    if (node.hasNestedTable()) {
      throw new CommandException(this, "Cell " + nodeIdArg
          + " has a nested table. It cannot be edited.");
    }   
    node.setValue(newValueArg, Node.NodeStatus.edited,
        workspace.getFactory());
    WorksheetUpdateFactory.detectSelectionStatusChange(worksheetId, workspace, this);
View Full Code Here

Examples of net.aufdemrand.denizen.utilities.command.exceptions.CommandException

        if (sender instanceof Player) player = dPlayer.mirrorBukkitPlayer((Player) sender);

        if (args.hasValueFlag("player"))
            player = dPlayer.valueOf(args.getFlag("player"));

        if (player == null) throw new CommandException("Specified player not online or not found!");

        Map<String,AbstractListener> listeners = denizen.getListenerRegistry().getListenersFor(player);

        if (listeners == null || listeners.isEmpty()) {
            Messaging.send(sender, player.getName() + " has no active listeners.");
View Full Code Here

Examples of net.aufdemrand.denizen.utilities.command.exceptions.CommandException

                    paginator.addLine("<a>" + scriptContainer.getContainerType().substring(0, 3) + "  <b>" + script);
            } else paginator.addLine("<a>" + scriptContainer.getContainerType().substring(0, 3) + "  <b>" + script);
        }
        // Send the contents of the Paginator to the Player (or Console)
        if (!paginator.sendPage(sender, args.getInteger(1, 1)))
            throw new CommandException("The page " + args.getInteger(1, 1) + " does not exist.");
    }
View Full Code Here

Examples of net.canarymod.commandsys.CommandException

        }
        else if (caller instanceof Player) {
            player((Player) caller);
        }
        else {
            throw new CommandException("Unknown MessageReceiver: " + caller.getClass().getSimpleName());
        }
    }
View Full Code Here

Examples of net.citizensnpcs.api.command.exception.CommandException

            }
            paginator.addLine("");
        }

        if (!paginator.sendPage(sender, page))
            throw new CommandException(Messages.COMMAND_PAGE_MISSING, page);
    }
View Full Code Here

Examples of net.citizensnpcs.api.command.exception.CommandException

        } if (!entriesPresent) paginator.addLine("<c>No Interact Scripts assigned.");
        paginator.addLine("");

        if (!entriesPresent) {
            if (!paginator.sendPage(sender, page))
                throw new CommandException(Messages.COMMAND_PAGE_MISSING);
            return;
        }

        // Scheduled Activities
        entriesPresent = false;
        paginator.addLine(ChatColor.GRAY + "Scheduled Scripts:");
        paginator.addLine("<e>Key: <a>Time  <b>Name");
        if (assignmentScript.contains("SCHEDULED ACTIVITIES")) {
            entriesPresent = true;
            for (String scriptEntry : assignmentScript.getStringList("SCHEDULED ACTIVITIES"))
                paginator.addLine("<a>" + scriptEntry.split(" ")[0] + "<b> " + scriptEntry.split(" ", 2)[1]);
        } if (!entriesPresent) paginator.addLine("<c>No scheduled scripts activities.");
        paginator.addLine("");

        // Actions
        entriesPresent = false;
        paginator.addLine(ChatColor.GRAY + "Actions:");
        paginator.addLine("<e>Key: <a>Action name  <b>Script Size");
        if (assignmentScript.contains("ACTIONS")) entriesPresent = true;
        if (entriesPresent)
            for (String action : assignmentScript.getConfigurationSection("ACTIONS").getKeys(false))
                paginator.addLine("<a>" + action + " <b>" + assignmentScript.getStringList("ACTIONS." + action).size());
        else paginator.addLine("<c>No actions defined in the assignment.");
        paginator.addLine("");

        if (!paginator.sendPage(sender, page))
            throw new CommandException(Messages.COMMAND_PAGE_MISSING, page);
    }
View Full Code Here

Examples of net.citizensnpcs.api.command.exception.CommandException

    @Requirements(selected = true, ownership = true)
    public void constants(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
        if (!npc.hasTrait(ConstantsTrait.class)) npc.addTrait(ConstantsTrait.class);
        ConstantsTrait trait = npc.getTrait(ConstantsTrait.class);
        if (args.hasValueFlag("set")) {
            if (!args.hasValueFlag("value")) throw new CommandException("--SET requires use of the '--VALUE \"constant value\"' argument.");
            trait.setConstant(args.getFlag("set"), args.getFlag("value"));
            Messaging.sendInfo(sender, npc.getName() + " has added constant '" + args.getFlag("set") + "'.");
            return;

        } else if (args.hasValueFlag("remove")) {
            trait.removeConstant(args.getFlag("remove"));
            Messaging.sendInfo(sender, npc.getName() + " has removed constant '" + args.getFlag("remove") + "'.");
            return;

        } else if (args.length() > 2 && args.getInteger(1, 0) < 1) {
            Messaging.send(sender, "");
            Messaging.send(sender, "<f>Use '--set name' to add/set a new NPC-specific constant.");
            Messaging.send(sender, "<f>Must also specify '--value \"constant value\"'.");
            Messaging.send(sender, "<b>Example: /npc constant --set constant_1 --value \"test value\"");
            Messaging.send(sender, "<f>Remove NPC-specific constants with '--remove name'");
            Messaging.send(sender, "<f>Note: Constants set will override any specified in an");
            Messaging.send(sender, "<f>assignment. Constants specified in assignments cannot be");
            Messaging.send(sender, "<f>removed with this command.");
            Messaging.send(sender, "");
            return;
        }

        try {
            trait.describe(sender, args.getInteger(1, 1));
        } catch (net.citizensnpcs.api.command.exception.CommandException e) {
            throw new CommandException(e.getMessage());
        }
    }
View Full Code Here

Examples of net.citizensnpcs.api.command.exception.CommandException

        }

        try {
            trait.describe(sender, args.getInteger(1, 1));
        } catch (net.citizensnpcs.api.command.exception.CommandException e) {
            throw new CommandException(e.getMessage());
        }
    }
View Full Code Here

Examples of net.citizensnpcs.api.command.exception.CommandException

        }

        try {
            trait.describe(sender, args.getInteger(1, 1));
        } catch (net.citizensnpcs.api.command.exception.CommandException e) {
            throw new CommandException(e.getMessage());
        }
    }
View Full Code Here

Examples of net.citizensnpcs.api.command.exception.CommandException

                    + "<d> " + getCooldownType(entry.getKey()).name()
                    + "<e> " + (getRadius(entry.getKey()) == -1 ? "" : getRadius(entry.getKey()));
            paginator.addLine(line);
        }
        if (!paginator.sendPage(sender, page))
            throw new CommandException(Messages.COMMAND_PAGE_MISSING, page);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.