Package net.citizensnpcs.api.npc

Examples of net.citizensnpcs.api.npc.NPC


        ////////
        // Match NPC id

        string = string.toUpperCase().replace("N@", "");
        NPC npc;
        if (aH.matchesInteger(string)) {
            int id = aH.getIntegerFrom(string);

            if (dNPCRegistry._isRegistered(id))
                return dNPCRegistry.getDenizen(id);
View Full Code Here


        // If using object notation, assume it's valid
        if (string.toLowerCase().startsWith("n@")) return true;

        // Otherwise, let's do checks
        string = string.toUpperCase().replace("N@", "");
        NPC npc;
        if (aH.matchesInteger(string)) {
            npc = CitizensAPI.getNPCRegistry().getById(aH.getIntegerFrom(string));
            if (npc != null) return true;
        }
        else {
View Full Code Here

    public EntityLiving getHandle() {
        return ((CraftLivingEntity) getEntity()).getHandle();
    }

    public NPC getCitizen() {
        NPC npc = CitizensAPI.getNPCRegistry().getById(npcid);
        if (npc == null)
            dB.log("Uh oh! Denizen has encountered a NPE while trying to fetch an NPC. " +
                    "Has this NPC been removed?");
        return npc;
    }
View Full Code Here

    public String getOwner() {
        return getCitizen().getTrait(Owner.class).getOwner();
    }

    public AssignmentTrait getAssignmentTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(AssignmentTrait.class))
            npc.addTrait(AssignmentTrait.class);
        return npc.getTrait(AssignmentTrait.class);
    }
View Full Code Here

            npc.addTrait(AssignmentTrait.class);
        return npc.getTrait(AssignmentTrait.class);
    }

    public Equipment getEquipmentTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(Equipment.class))
            npc.addTrait(Equipment.class);
        return npc.getTrait(Equipment.class);
    }
View Full Code Here

            npc.addTrait(Equipment.class);
        return npc.getTrait(Equipment.class);
    }

    public NicknameTrait getNicknameTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(NicknameTrait.class))
            npc.addTrait(NicknameTrait.class);
        return npc.getTrait(NicknameTrait.class);
    }
View Full Code Here

            npc.addTrait(NicknameTrait.class);
        return npc.getTrait(NicknameTrait.class);
    }

    public FishingTrait getFishingTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(FishingTrait.class))
            npc.addTrait(FishingTrait.class);
        return npc.getTrait(FishingTrait.class);
    }
View Full Code Here

            npc.addTrait(FishingTrait.class);
        return npc.getTrait(FishingTrait.class);
    }

    public HealthTrait getHealthTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(HealthTrait.class))
            npc.addTrait(HealthTrait.class);
        return npc.getTrait(HealthTrait.class);
    }
View Full Code Here

            npc.addTrait(HealthTrait.class);
        return npc.getTrait(HealthTrait.class);
    }

    public net.citizensnpcs.api.trait.trait.Inventory getInventoryTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(net.citizensnpcs.api.trait.trait.Inventory.class))
            npc.addTrait(net.citizensnpcs.api.trait.trait.Inventory.class);
        return npc.getTrait(net.citizensnpcs.api.trait.trait.Inventory.class);
    }
View Full Code Here

            npc.addTrait(net.citizensnpcs.api.trait.trait.Inventory.class);
        return npc.getTrait(net.citizensnpcs.api.trait.trait.Inventory.class);
    }

    public LookClose getLookCloseTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(LookClose.class))
            npc.addTrait(LookClose.class);
        return npc.getTrait(LookClose.class);
    }
View Full Code Here

TOP

Related Classes of net.citizensnpcs.api.npc.NPC

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.