Package net.aufdemrand.denizencore.exceptions

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException


            else arg.reportUnhandled();

        }

        if (!scriptEntry.hasObject("script") && !scriptEntry.hasObject("local"))
            throw new InvalidArgumentsException("Must define a SCRIPT to be run.");

        if (!scriptEntry.hasObject("path") && scriptEntry.hasObject("local"))
            throw new InvalidArgumentsException("Must specify a PATH.");

    }
View Full Code Here


        scriptEntry.defaultObject("location",
                ((BukkitScriptEntryData)scriptEntry.entryData).hasNPC() ? ((BukkitScriptEntryData)scriptEntry.entryData).getNPC().getLocation() : null,
                ((BukkitScriptEntryData)scriptEntry.entryData).hasPlayer() ? ((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getLocation() : null);

        if (!scriptEntry.hasObject("location")) {
            throw new InvalidArgumentsException("Missing location argument!");
        }
    }
View Full Code Here

            if (!scriptEntry.hasObject("entity_type")
                    && arg.matchesArgumentType(dEntity.class)) {
                // Avoid duplication of objects
                dEntity ent = arg.asType(dEntity.class);
                if (!ent.isGeneric() && !ent.isNPC())
                    throw new InvalidArgumentsException("Entity supplied must be generic or an NPC!");
                scriptEntry.addObject("entity_type", ent);
            }

            else if (!scriptEntry.hasObject("spawn_location")
                    && arg.matchesArgumentType(dLocation.class))
View Full Code Here

        }

        // Only required thing is a valid NPC. This may be an already linked
        // NPC, or one specified by arguments
        if (((BukkitScriptEntryData)scriptEntry.entryData).getNPC() == null)
            throw new InvalidArgumentsException("NPC linked was missing or invalid.");

    }
View Full Code Here

            else arg.reportUnhandled();
        }

        // Check required arguments
        if (!scriptEntry.hasObject("location") && !scriptEntry.hasObject("cuboid"))
            throw new InvalidArgumentsException("Must specify a source loaction or cuboid.");

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

        // Set defaults
        scriptEntry.defaultObject("remove", Element.FALSE);
    }
View Full Code Here

        //stand should have no additional arguments
        for (aH.Argument arg : aH.interpret(scriptEntry.getArguments())) {
            arg.reportUnhandled();
        }
        if (!((BukkitScriptEntryData)scriptEntry.entryData).hasNPC())
            throw new InvalidArgumentsException("This command requires a linked NPC!");

    }
View Full Code Here

        if (!scriptEntry.hasObject("list")
                && !scriptEntry.hasObject("stop")
                && !scriptEntry.hasObject("next")
                && !scriptEntry.hasObject("callback"))
            throw new InvalidArgumentsException("Must specify a valid list or 'stop' or 'next'!");
    }
View Full Code Here

        if (!scriptEntry.hasObject("display") && scriptEntry.getObject("action").equals(Action.CREATE))
            scriptEntry.addObject("display", Display.LOCATION);

        if (!scriptEntry.hasObject("id"))
            throw new InvalidArgumentsException("Must specify a Viewer ID!");

        if (!scriptEntry.hasObject("location") && scriptEntry.getObject("action").equals(Action.CREATE))
            throw new InvalidArgumentsException("Must specify a Sign location!");

        if (!scriptEntry.hasObject("type") && scriptEntry.getObject("action").equals(Action.CREATE))
            scriptEntry.addObject("type", Type.SIGN_POST);
    }
View Full Code Here

            else arg.reportUnhandled();
        }

        if (!scriptEntry.hasObject("sqlid")) {
            throw new InvalidArgumentsException("Must specify an ID!");
        }

        if (!scriptEntry.hasObject("action")) {
            throw new InvalidArgumentsException("Must specify an action!");
        }
    }
View Full Code Here

                arg.reportUnhandled();

        }

        if (!scriptEntry.hasObject("script") && !scriptEntry.hasObject("local"))
            throw new InvalidArgumentsException("Must define a SCRIPT to be injected.");

        if (!scriptEntry.hasObject("path") && scriptEntry.hasObject("local"))
            throw new InvalidArgumentsException("Must specify a PATH.");

    }
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.