Package net.aufdemrand.denizen.objects

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


        dB.report(scriptEntry, getName(),
                    traitName.debug() +
                    toggle.debug() +
                    ((BukkitScriptEntryData)scriptEntry.entryData).getNPC().debug());

        Class<? extends Trait> trait = CitizensAPI.getTraitFactory().getTraitClass(traitName.asString());

        if (trait == null) {
            dB.echoError(scriptEntry.getResidingQueue(), "Trait not found: " + traitName.asString());
            return;
        }
View Full Code Here


                    ((BukkitScriptEntryData)scriptEntry.entryData).getNPC().debug());

        Class<? extends Trait> trait = CitizensAPI.getTraitFactory().getTraitClass(traitName.asString());

        if (trait == null) {
            dB.echoError(scriptEntry.getResidingQueue(), "Trait not found: " + traitName.asString());
            return;
        }

        switch (Toggle.valueOf(toggle.asString())) {
View Full Code Here

        switch (Toggle.valueOf(toggle.asString())) {

            case TRUE:
            case ON:
                if (npc.hasTrait(trait))
                    dB.echoError(scriptEntry.getResidingQueue(), "NPC already has trait '" + traitName.asString() + "'");
                else
                    npc.addTrait(trait);
                break;

            case FALSE:
View Full Code Here

                break;

            case FALSE:
            case OFF:
                if (!npc.hasTrait(trait))
                    dB.echoError(scriptEntry.getResidingQueue(), "NPC does not have trait '" + traitName.asString() + "'");
                else
                    npc.removeTrait(trait);
                break;

            case TOGGLE:
View Full Code Here

            npc.getCitizen().addTrait(Anchors.class);

        switch (action) {

            case ADD:
                npc.getCitizen().getTrait(Anchors.class).addAnchor(id.asString(), location);
                return;

            case ASSUME:
            {
                Anchor n = npc.getCitizen().getTrait(Anchors.class)
View Full Code Here

                return;

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

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

                return;

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

            case WALKNEAR:
            {
                Anchor n = npc.getCitizen().getTrait(Anchors.class)
                        .getAnchor(id.asString());
                if (n == null)
                    dB.echoError(scriptEntry.getResidingQueue(), "Invalid anchor name '" + id.asString() + "'");
                else if (range == null)
                    dB.echoError(scriptEntry.getResidingQueue(), "Must specify a range!");
                else
                    npc.getNavigator().setTarget(
                        Utilities.getWalkableLocationNear(n.getLocation(), range.asInt()));
View Full Code Here

                return;

            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());
            }
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.