Package net.aufdemrand.denizen.objects

Examples of net.aufdemrand.denizen.objects.Element.asString()


            case WALKTO:
            {
                Anchor n = npc.getCitizen().getTrait(Anchors.class)
                        .getAnchor(id.asString());
                if (n == null)
                    dB.echoError(scriptEntry.getResidingQueue(), "Invalid anchor name '" + id.asString() + "'");
                else
                    npc.getNavigator().setTarget(n.getLocation());
            }
                return;
View Full Code Here


                return;

            case REMOVE:
            {
                Anchor n = npc.getCitizen().getTrait(Anchors.class)
                        .getAnchor(id.asString());
                if (n == null)
                    dB.echoError(scriptEntry.getResidingQueue(), "Invalid anchor name '" + id.asString() + "'");
                else
                    npc.getCitizen().getTrait(Anchors.class).removeAnchor(n);
            }
View Full Code Here

            case REMOVE:
            {
                Anchor n = npc.getCitizen().getTrait(Anchors.class)
                        .getAnchor(id.asString());
                if (n == null)
                    dB.echoError(scriptEntry.getResidingQueue(), "Invalid anchor name '" + id.asString() + "'");
                else
                    npc.getCitizen().getTrait(Anchors.class).removeAnchor(n);
            }
        }
View Full Code Here

    public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
        // Fetch objects
        Duration value = (Duration) scriptEntry.getObject("value");
        dWorld world = (dWorld) scriptEntry.getObject("world");
        Element type_element = scriptEntry.getElement("type");
        Type type = Type.valueOf(type_element.asString().toUpperCase());

        // Report to dB
        dB.report(scriptEntry, getName(), type_element.debug()
                                          + value.debug()
                                          + world.debug());
View Full Code Here

            case NEW:
                // First make sure there isn't already a 'player listener' for this player with the specified ID.
                if (DenizenAPI.getCurrentInstance().getListenerRegistry()
                        .getListenersFor(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer()) != null
                        && DenizenAPI.getCurrentInstance().getListenerRegistry().getListenersFor(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer())
                        .containsKey(id.asString().toLowerCase())) {
                    dB.echoError(scriptEntry.getResidingQueue(), "Cancelled creation of NEW listener! Listener ID '" + id.asString() + "' already exists!");
                    break;
                }

                // Also make sure there is a valid script input
View Full Code Here

                // First make sure there isn't already a 'player listener' for this player with the specified ID.
                if (DenizenAPI.getCurrentInstance().getListenerRegistry()
                        .getListenersFor(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer()) != null
                        && DenizenAPI.getCurrentInstance().getListenerRegistry().getListenersFor(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer())
                        .containsKey(id.asString().toLowerCase())) {
                    dB.echoError(scriptEntry.getResidingQueue(), "Cancelled creation of NEW listener! Listener ID '" + id.asString() + "' already exists!");
                    break;
                }

                // Also make sure there is a valid script input
                if (finish_script == null) {
View Full Code Here

                    break;
                }

                try {
                    DenizenAPI.getCurrentInstance().getListenerRegistry().get(type.asString())
                            .createInstance(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer(), id.asString())
                            .build(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer(),
                                    id.asString(),
                                    type.asString(),
                                    arguments,
                                    finish_script,
View Full Code Here

                try {
                    DenizenAPI.getCurrentInstance().getListenerRegistry().get(type.asString())
                            .createInstance(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer(), id.asString())
                            .build(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer(),
                                    id.asString(),
                                    type.asString(),
                                    arguments,
                                    finish_script,
                                    ((BukkitScriptEntryData)scriptEntry.entryData).getNPC());
View Full Code Here

                    // problems.
                    else
                        dB.echoError(scriptEntry.getResidingQueue(), e);

                    // Deconstruct the listener in case it was partially created while erroring out.
                    try { DenizenAPI.getCurrentInstance().getListenerRegistry().getListenerFor(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer(), id.asString()).cancel(); }
                    catch (Exception ex) { }
                }
                break;

            case FINISH:
View Full Code Here

                }
                break;

            case FINISH:
                if (DenizenAPI.getCurrentInstance().getListenerRegistry()
                        .getListenerFor(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer(), id.asString()) != null)
                    DenizenAPI.getCurrentInstance().getListenerRegistry()
                            .getListenerFor(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer(), id.asString()).finish();
                break;

            case CANCEL:
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.