Package net.aufdemrand.denizen.npc.traits

Examples of net.aufdemrand.denizen.npc.traits.TriggerTrait


                        npc.debug());

        // Add trigger trait
        if (!npc.getCitizen().hasTrait(TriggerTrait.class)) npc.getCitizen().addTrait(TriggerTrait.class);

        TriggerTrait trait = npc.getCitizen().getTrait(TriggerTrait.class);

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

            case TOGGLE:
                trait.toggleTrigger(trigger.asString());
                break;

            case TRUE:
                trait.toggleTrigger(trigger.asString(), true);
                break;

            case FALSE:
                trait.toggleTrigger(trigger.asString(), false);
                break;
        }

        if (radius != null)
            trait.setLocalRadius(trigger.asString(), radius.asInt());

        if (cooldown != null && cooldown.getSeconds() > 0)
            trait.setLocalCooldown(trigger.asString(), cooldown.getSeconds());
    }
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizen.npc.traits.TriggerTrait

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.