Package net.citizensnpcs.npcdata

Examples of net.citizensnpcs.npcdata.NPCData


        HumanNPC npc = NPCSpawner.spawnNPC(UID, npcName, loc);

        NPCCreateEvent event = new NPCCreateEvent(npc, reason, loc);
        Bukkit.getServer().getPluginManager().callEvent(event);

        npc.setNPCData(new NPCData(npcName, UID, loc, colour, PropertyManager.getBasic().getItems(UID),
                NPCDataManager.NPCTexts.get(UID), PropertyManager.getBasic().isTalk(UID), PropertyManager.getBasic()
                        .isLookWhenClose(UID), PropertyManager.getBasic().isTalkWhenClose(UID), owner));
        PropertyManager.getBasic().saveOwner(UID, owner);
        PropertyManager.load(npc);
View Full Code Here


    @Override
    public void loadState(HumanNPC npc) {
        int UID = npc.getUID();

        NPCData npcdata = npc.getNPCData();

        npcdata.setTalk(isTalk(UID));
        npcdata.setName(getName(UID));
        npcdata.setLocation(getLocation(UID));
        npcdata.setColour(getColour(UID));
        npcdata.setItems(getItems(UID));
        npcdata.setTexts(getText(UID));
        npcdata.setLookClose(isLookWhenClose(UID));
        npcdata.setTalkClose(isTalkWhenClose(UID));
        npcdata.setOwner(getOwner(UID));
        npc.getWaypoints().setPoints(getWaypoints(UID, npc.getWorld()));
        npc.setBalance(getBalance(npc.getUID()));

        NPCDataManager.addItems(npc, npcdata.getItems());
        if (getInventory(npc.getUID()) != null) {
            npc.getInventory().setContents(getInventory(npc.getUID()).getContents());
        }
        npc.getHandle().setAutoPathfinder(profiles.getBoolean(UID + ".basic.wander", false));
        saveState(npc);
View Full Code Here

    @Override
    public void saveState(HumanNPC npc) {
        int UID = npc.getUID();

        NPCData npcdata = npc.getNPCData();

        saveBalance(npc.getUID(), npc.getBalance());
        saveName(npc.getUID(), npcdata.getName());
        saveLocation(npcdata.getLocation(), UID);
        saveColour(UID, npcdata.getColour());
        saveItems(UID, npcdata.getItems());
        saveInventory(UID, npc.getPlayer().getInventory());
        saveText(UID, npcdata.getTexts());
        saveLookWhenClose(UID, npcdata.isLookClose());
        saveTalkWhenClose(UID, npcdata.isTalkClose());
        saveTalk(UID, npcdata.isTalk());
        saveWaypoints(UID, npc.getWaypoints().getWaypoints());
        saveOwner(UID, npcdata.getOwner());

        profiles.setBoolean(UID + ".basic.wander", npc.getHandle().isAutoPathfinder());
    }
View Full Code Here

TOP

Related Classes of net.citizensnpcs.npcdata.NPCData

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.