Package net.aufdemrand.denizen

Examples of net.aufdemrand.denizen.BukkitScriptEntryData


                    for (WorldScriptContainer script : events.get("ON " + eventName.toUpperCase())) {

                        if (script == null) continue;

                        // Fetch script from Event
                        List<ScriptEntry> entries = script.getEntries(new BukkitScriptEntryData(player, npc), "events.on " + eventName);

                        if (entries.isEmpty()) continue;

                        dB.report(script, "Event",
                                aH.debugObj("Type", "on " + eventName)
View Full Code Here


    public ScriptEntry(String command, String[] arguments, ScriptContainer script) throws ScriptEntryCreationException {

        if (command == null)
            throw new ScriptEntryCreationException("dCommand 'name' cannot be null!");

        entryData = new BukkitScriptEntryData(null, null); // TODO: Make version-cross-compatible

        this.command = command.toUpperCase();

        // Knowing which script created this entry provides important context. We'll store
        // a dScript object of the container if script is not null.
View Full Code Here

                        + aH.debugObj("NPC", npc.toString())
                        + assignment.getAsScriptArg().debug()
                        + (player != null ? aH.debugObj("Player", player.getName()) : ""));

        // Fetch script from Actions
        List<ScriptEntry> script = assignment.getEntries(new BukkitScriptEntryData(player, npc), "actions.on " + actionName);
        if (script.isEmpty()) return determination;

        // Create new ID -- this is what we will look for when determining an outcome
        long id = DetermineCommand.getNewId();
View Full Code Here

        ScriptQueue queue;
        if (getSpeed().getSeconds() == 0)
            queue = InstantQueue.getQueue(queueId);
        else queue = TimedQueue.getQueue(queueId).setSpeed(getSpeed().getTicks());

        List<ScriptEntry> listOfEntries = getBaseEntries(new BukkitScriptEntryData(player, npc));
        if (context != null)
            ScriptBuilder.addObjectToEntries(listOfEntries, "context", context);
        queue.addEntries(listOfEntries);
        queue.start();
        return queue;
View Full Code Here

        ScriptQueue queue;
        if (getSpeed().getSeconds() == 0)
            queue = InstantQueue.getQueue(queueId);
        else queue = TimedQueue.getQueue(queueId).setSpeed(getSpeed().getTicks());

        List<ScriptEntry> listOfEntries = getBaseEntries(new BukkitScriptEntryData(player, npc));
        if (context != null)
            ScriptBuilder.addObjectToEntries(listOfEntries, "context", context);
        queue.addEntries(listOfEntries);
        queue.delayUntil(System.currentTimeMillis() + (long) (delay.getSeconds() * 1000));
        queue.start();
View Full Code Here

        return queue;
    }

    public ScriptQueue injectTaskScript(String queueId, dPlayer player, dNPC npc, Map<String, String> context) {
        ScriptQueue queue = ScriptQueue._getExistingQueue(queueId);
        List<ScriptEntry> listOfEntries = getBaseEntries(new BukkitScriptEntryData(player, npc));
        if (context != null)
            ScriptBuilder.addObjectToEntries(listOfEntries, "context", context);
        queue.injectEntries(listOfEntries, 0);
        queue.start();
        return queue;
View Full Code Here

        // Check for entries
        if (contains("STEPS." + InteractScriptHelper.getCurrentStep(player, getName()) + "."
                + triggerName + " TRIGGER."
                + (id == null ? "SCRIPT" : id.toUpperCase() + ".SCRIPT"))) {
            // Entries exist, so get them and return the list of ScriptEntries
            return getEntries(new BukkitScriptEntryData(player, npc),
                    "STEPS." + InteractScriptHelper.getCurrentStep(player, getName()) + "."
                            + triggerName + " TRIGGER."
                            + (id == null ? "SCRIPT" : id.toUpperCase() + ".SCRIPT"));
            // No entries, so just return an empty list to avoid NPEs
        } else {
View Full Code Here

        return getString("PERMISSION MESSAGE");
    }

    public ScriptQueue runCommandScript(dPlayer player, dNPC npc, Map<String, dObject> context) {
        ScriptQueue queue = InstantQueue.getQueue(ScriptQueue.getNextId(getName())).addEntries(getBaseEntries(
                new BukkitScriptEntryData(player, npc)));
        if (context != null) {
            for (Map.Entry<String, dObject> entry : context.entrySet()) {
                queue.addContext(entry.getKey(), entry.getValue());
            }
        }
View Full Code Here

        return queue;
    }

    public boolean runAllowedHelpProcedure(dPlayer player, dNPC npc, Map<String, dObject> context) {
        // Add the reqId to each of the entries for the determine command
        List<ScriptEntry> entries = getEntries(new BukkitScriptEntryData(player, npc), "ALLOWED HELP");
        long id = DetermineCommand.getNewId();
        ScriptBuilder.addObjectToEntries(entries, "ReqId", id);

        ScriptQueue queue = InstantQueue.getQueue(ScriptQueue.getNextId(getName())).setReqId(id).addEntries(entries);
        if (context != null) {
View Full Code Here

        return DetermineCommand.getOutcome(id).equalsIgnoreCase("true");
    }

    public List<String> runTabCompleteProcedure(dPlayer player, dNPC npc, Map<String, dObject> context) {
        // Add the reqId to each of the entries for the determine command
        List<ScriptEntry> entries = getEntries(new BukkitScriptEntryData(player, npc), "TAB COMPLETE");
        long id = DetermineCommand.getNewId();
        ScriptBuilder.addObjectToEntries(entries, "ReqId", id);

        ScriptQueue queue = InstantQueue.getQueue(ScriptQueue.getNextId(getName())).setReqId(id).addEntries(entries);
        if (context != null) {
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizen.BukkitScriptEntryData

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.