Package net.aufdemrand.denizen.scripts.queues.core

Examples of net.aufdemrand.denizen.scripts.queues.core.TimedQueue


        List<ScriptEntry> entries = script.getEntriesFor(this.getClass(), player, npc, id, true);
        if (entries.isEmpty()) return false;

        dB.echoDebug(script, DebugElement.Header, "Parsing " + name + " trigger: n@" + npc.getName() + "/p@" + player.getName());
        // Create Queue
        TimedQueue queue = TimedQueue.getQueue(ScriptQueue.getNextId(script.getName()));
        // Add all entries to set it up
        queue.addEntries(entries);
        // Add context
        if (context != null) {
            for (Map.Entry<String, dObject> entry : context.entrySet()) {
                queue.addContext(entry.getKey(), entry.getValue());
            }
        }
        // Start it
        queue.start();

        return true;
    }
View Full Code Here


     * @param delay how long to delay initially.
     * @return the newly created queue.
     */
    public TimedQueue forceToTimed(Duration delay) {
        stop();
        TimedQueue newQueue = TimedQueue.getQueue(id);
        for (ScriptEntry entry: getEntries()) {
            entry.setInstant(true);
        }
        newQueue.addEntries(getEntries());
        for (Map.Entry<String, String> def: getAllDefinitions().entrySet()) {
            newQueue.addDefinition(def.getKey(), def.getValue());
        }
        for (Map.Entry<String, dObject> entry: getAllContext().entrySet()) {
            newQueue.addContext(entry.getKey(), entry.getValue());
        }
        for (Map.Entry<String, ScriptEntry> entry: held_entries.entrySet()) {
            newQueue.holdScriptEntry(entry.getKey(), entry.getValue());
        }
        newQueue.setLastEntryExecuted(getLastEntryExecuted());
        clear();
        if (delay != null)
            newQueue.delayFor(delay);
        newQueue.start();
        return newQueue;
    }
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizen.scripts.queues.core.TimedQueue

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.