mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 16:55:12 +00:00
Party Quest Tracking
This commit is contained in:
1 parent
7a251ad64e
commit
67d4b3bd15
16 files changed
+308
-36
No files matched your search
@@ -2,9 +2,11 @@ package noppes.npcs;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.handler.data.IQuest;
|
||||
import noppes.npcs.constants.EnumQuestCompletion;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.PlayerQuestController;
|
||||
import noppes.npcs.controllers.data.Party;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
|
||||
@@ -47,6 +49,17 @@ public class QuestLogData {
|
||||
partyQuests = NBTTags.getStringIntegerMap(compound.getTagList("PartyQuests", 10));
|
||||
partyOptions = NBTTags.getVectorMap(compound.getTagList("PartyOptions", 10));
|
||||
}
|
||||
|
||||
public NBTTagCompound writeTrackedQuest(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setString("TrackedQuestID", trackedQuestKey);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readTrackedQuest(NBTTagCompound compound){
|
||||
trackedQuestKey = compound.getString("TrackedQuestID");
|
||||
}
|
||||
|
||||
public void setData(EntityPlayer player){
|
||||
PlayerData playerData = PlayerDataController.Instance.getPlayerData(player);
|
||||
|
||||
@@ -76,8 +89,36 @@ public class QuestLogData {
|
||||
partyOptions.put(key, quest.partyOptions.getPartyOptionsList());
|
||||
}
|
||||
}
|
||||
|
||||
Party party = playerData.getPlayerParty();
|
||||
if(party != null && party.getQuest() != null){
|
||||
if (playerData.questData.getTrackedQuest() != null) {
|
||||
if (party.getQuest().getId() == playerData.questData.getTrackedQuest().getId()) {
|
||||
trackedQuestKey = "P" + ":" + party.getQuest().getCategory().getName() + ":" + party.getQuest().getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setTrackedQuestKey(EntityPlayer player){
|
||||
PlayerData playerData = PlayerDataController.Instance.getPlayerData(player);
|
||||
|
||||
Party party = playerData.getPlayerParty();
|
||||
if(party != null && party.getQuest() != null){
|
||||
if (playerData.questData.getTrackedQuest() != null) {
|
||||
if (party.getQuest().getId() == playerData.questData.getTrackedQuest().getId()) {
|
||||
trackedQuestKey = "P" + ":" + party.getQuest().getCategory().getName() + ":" + party.getQuest().getName();
|
||||
}
|
||||
}
|
||||
} else if(playerData.questData != null && playerData.questData.getTrackedQuest() != null){
|
||||
IQuest quest = playerData.questData.getTrackedQuest();
|
||||
trackedQuestKey = quest.getCategory().getName() + ":" + quest.getName();
|
||||
}
|
||||
else {
|
||||
trackedQuestKey = "";
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasSelectedQuest() {
|
||||
return !selectedQuest.isEmpty();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user