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

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


                else
                    sender.sendMessage(ChatColor.YELLOW + "Executing dCommand... to see debug, use /denizen debug");
            }

            entries.add(entry);
            InstantQueue queue = InstantQueue.getQueue(ScriptQueue.getNextId("EXCOMMAND"));
            dNPC npc = null;
            if (Depends.citizens != null && Depends.citizens.getNPCSelector().getSelected(sender) != null)
                npc = new dNPC(Depends.citizens.getNPCSelector().getSelected(sender));
            List<ScriptEntry> scriptEntries = ScriptBuilder.buildScriptEntries(entries, null,
                    (sender instanceof Player)?dPlayer.mirrorBukkitPlayer((Player) sender):null, npc);

            queue.addEntries(scriptEntries);
            queue.start();
            return true;
        }

        //if (Depends.citizens != null)
        //    return citizens.onCommand(sender, cmd, cmdName, args);
View Full Code Here


                        if (entries.isEmpty()) {
                            return 0;
                        }
                        long id = DetermineCommand.getNewId();
                        ScriptBuilder.addObjectToEntries(entries, "ReqId", id);
                        InstantQueue queue = InstantQueue.getQueue(ScriptQueue.getNextId("DLIST_SORT"));
                        queue.addEntries(entries);
                        queue.setReqId(id);
                        int x = 1;
                        dList definitions = new dList();
                        definitions.add(o1);
                        definitions.add(o2);
                        String[] definition_names = null;
                        try { definition_names = script.getString("definitions").split("\\|"); } catch (Exception e) { /* IGNORE */ }
                        for (String definition : definitions) {
                            String name = definition_names != null && definition_names.length >= x ?
                                    definition_names[x - 1].trim() : String.valueOf(x);
                            queue.addDefinition(name, definition);
                            dB.echoDebug(entry, "Adding definition %" + name + "% as " + definition);
                            x++;
                        }
                        queue.start();
                        int res = 0;
                        if (DetermineCommand.hasOutcome(id))
                            res = new Element(DetermineCommand.getOutcome(id)).asInt();
                        if (res < 0)
                            return -1;
View Full Code Here

        long id = DetermineCommand.getNewId();

        // Add the reqId to each of the entries for referencing
        ScriptBuilder.addObjectToEntries(entries, "ReqId", id);

        InstantQueue queue = InstantQueue.getQueue(ScriptQueue.getNextId(script.getContainer().getName()));
        queue.addEntries(entries);
        queue.setReqId(id);
        if (event.hasType() &&
                event.getType().equalsIgnoreCase("context") &&
                event.hasTypeContext()) {
            attribs = 2;
            int x = 1;
            dList definitions = new dList(event.getTypeContext());
            String[] definition_names = null;

            try { definition_names = script.getContainer().getString("definitions").split("\\|");
            } catch (Exception e) { }

            for (String definition : definitions) {
                String name = definition_names != null && definition_names.length >= x ?
                        definition_names[x - 1].trim() : String.valueOf(x);
                queue.addDefinition(name, definition);
                dB.echoDebug(event.getScriptEntry(), "Adding definition %" + name + "% as " + definition);
                x++;
            }
        }

        queue.start();

        if (DetermineCommand.hasOutcome(id)) {
            event.setReplaced(ObjectFetcher.pickObjectFor(DetermineCommand.getOutcome(id))
                    .getAttribute(attr.fulfill(attribs)));
        }
View Full Code Here

TOP

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

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.