Package net.aufdemrand.denizencore.exceptions

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException


            else if (ScriptRegistry.containsScript(aH.getStringFrom(arg))) {
                script = aH.getScriptFrom(arg);
                if (!script.getType().equalsIgnoreCase("TASK"))
                    script = null;

            } else throw new InvalidArgumentsException("Unknown argument '" + arg + "'!");
        }

        // Must specify at least a valid script to run...
        if (script == null)
            throw new InvalidArgumentsException("Must define a SCRIPT to be run.");
        // If not queue, and delayed, throw an exception... this cannot happen.
        if (queue.equals(scriptEntry.getResidingQueue().id) && delay != null)
            throw new InvalidArgumentsException("Cannot delay an INJECTED task script! Use 'QUEUE'.");

        // Put important objects inside the scriptEntry to be sent to execute()
        scriptEntry.addObject("instant", instant)
                .addObject("queue", queue)
                .addObject("delay", (delay != null ? delay.setPrefix("Delay") : null))
View Full Code Here


            else
                arg.reportUnhandled();
        }

        if (!scriptEntry.hasObject("location"))
            throw new InvalidArgumentsException("Missing location argument!");

        if (!scriptEntry.hasObject("action"))
            scriptEntry.addObject("action", new Element("ADD"));

        if (!scriptEntry.hasObject("duration"))
View Full Code Here

            else arg.reportUnhandled();
        }

        // Check for required information
        if (!scriptEntry.hasObject("world_name"))
            throw new InvalidArgumentsException("Must specify a world name.");

        if (!scriptEntry.hasObject("worldtype"))
            scriptEntry.addObject("worldtype", new Element("NORMAL"));
    }
View Full Code Here

                arg.reportUnhandled();
        }

        // Check for required information
         if (!scriptEntry.hasObject("required_object"))
          throw new InvalidArgumentsException("Must have required object!");

    }
View Full Code Here

                break;
            }
        }

        if (!scriptEntry.hasObject("qty") && !scriptEntry.hasObject("stop") && !scriptEntry.hasObject("next") && !scriptEntry.hasObject("callback"))
            throw new InvalidArgumentsException("Must specify a quantity or 'stop' or 'next'!");

        scriptEntry.addObject("braces", getBracedCommands(scriptEntry));

    }
View Full Code Here

                arg.reportUnhandled();
        }

        // Make sure location and entity were fulfilled
        if (!scriptEntry.hasObject("location"))
            throw new InvalidArgumentsException("Must specify a location!");

        // Use the NPC or the Player as the default entity
        scriptEntry.defaultObject("entity",
                (((BukkitScriptEntryData)scriptEntry.entryData).hasNPC() ? ((BukkitScriptEntryData)scriptEntry.entryData).getNPC().getDenizenEntity() : null));

        if (!scriptEntry.hasObject("entity"))
            throw new InvalidArgumentsException("Must specify an entity!");

        scriptEntry.defaultObject("radius", new Element(2));

    }
View Full Code Here

        }

        // Check to make sure required arguments have been filled

        if (!scriptEntry.hasObject("location"))
            throw new InvalidArgumentsException("Must specify a Sign location!");

        if (!scriptEntry.hasObject("text"))
            throw new InvalidArgumentsException("Must specify sign text!");

        // Default to SIGN_POST type
        scriptEntry.defaultObject("type", new Element(Type.AUTOMATIC.name()));
    }
View Full Code Here

                arg.reportUnhandled();

        }

        if (!scriptEntry.hasObject("sound"))
            throw new InvalidArgumentsException("Missing sound argument!");
        if (!scriptEntry.hasObject("locations") && !scriptEntry.hasObject("entities"))
            throw new InvalidArgumentsException("Missing location argument!");

        scriptEntry.defaultObject("volume", new Element(1));
        scriptEntry.defaultObject("pitch", new Element(1));
        scriptEntry.defaultObject("custom", Element.FALSE);
View Full Code Here

            else
                arg.reportUnhandled();
        }

        if(!scriptEntry.hasObject("message"))
            throw new InvalidArgumentsException("Must specify a message.");

        if(!scriptEntry.hasObject("file"))
            throw new InvalidArgumentsException("Must specify a file.");

        if (!scriptEntry.hasObject("type"))
            scriptEntry.addObject("type", new Element("INFO"));
    }
View Full Code Here

            else
                arg.reportUnhandled();
        }

        if (!scriptEntry.hasObject("actions"))
            throw new InvalidArgumentsException("Must specify a list of action names!");

        if (!scriptEntry.hasObject("npcs")) {
            if (((BukkitScriptEntryData)scriptEntry.entryData).hasNPC())
                scriptEntry.addObject("npcs", Arrays.asList(((BukkitScriptEntryData)scriptEntry.entryData).getNPC()));
            else
                throw new InvalidArgumentsException("Must specify an NPC to use!");
        }

        scriptEntry.defaultObject("context", new dList());

    }
View Full Code Here

TOP

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

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.