Package net.citizensnpcs.util

Examples of net.citizensnpcs.util.Anchor


                npc.getCitizen().getTrait(Anchors.class).addAnchor(id.asString(), location);
                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());
            }
                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
                    npc.getNavigator().setTarget(
                        Utilities.getWalkableLocationNear(n.getLocation(), range.asInt()));
            }
                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());
            }
                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

TOP

Related Classes of net.citizensnpcs.util.Anchor

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.