Fix QuestPing and Automatic Quest Checker

This commit is contained in:
Kam committed 2024-03-07 04:50:10 -05:00
1 parent 1c77828f28
commit 47dcc62d4f
2 files changed
+17 -14

No files matched your search

@@ -382,7 +382,21 @@ public class GuiParty extends GuiCNPCInventory implements ITextfieldListener, IT
@Override
public void setPartyData(NBTTagCompound compound) {
this.receivedData = true;
ClientCacheHandler.party = null;
if (compound.hasKey("QuestPing")) {
this.questLogStatus.clear();
this.questCompleteWith = "";
if (compound.hasKey("QuestProgress")) {
NBTTagList tagList = compound.getTagList("QuestProgress", 8);
for (int i = 0; i < tagList.tagCount(); i++) {
this.questLogStatus.add(tagList.getStringTagAt(i));
}
}
if (compound.hasKey("QuestCompleteWith")) {
this.questCompleteWith = compound.getString("QuestCompleteWith");
}
} else {
ClientCacheHandler.party = null;
}
if (compound.hasKey("PartyUUID")) {
UUID uuid = UUID.fromString(compound.getString("PartyUUID"));
@@ -412,18 +426,6 @@ public class GuiParty extends GuiCNPCInventory implements ITextfieldListener, IT
String partyUUID = listCompound.getString("PartyUUID");
this.invites.put(inviteName, partyUUID);
}
} else if (compound.hasKey("QuestProgress")) {
this.questLogStatus.clear();
this.questCompleteWith = "";
if (compound.hasKey("QuestProgress")) {
NBTTagList tagList = compound.getTagList("QuestProgress", 8);
for (int i = 0; i < tagList.tagCount(); i++) {
this.questLogStatus.add(tagList.getStringTagAt(i));
}
}
if (compound.hasKey("QuestCompleteWith")) {
this.questCompleteWith = compound.getString("QuestCompleteWith");
}
}
initGui();
@@ -145,6 +145,7 @@ public class PartyController {
return;
NBTTagCompound compound = new NBTTagCompound();
compound.setInteger("QuestPing", 0);
if (party.getQuest() != null) {
Quest quest = (Quest) party.getQuest();
Vector<String> vector = quest.questInterface.getPartyQuestLogStatus(party);
@@ -191,7 +192,7 @@ public class PartyController {
public boolean checkQuestCompletion(Party party, EnumQuestType type) {
QuestData questData = party.getQuestData();
if(questData != null){
if(questData.quest.type != type && type != null){
if(questData.quest.type == type || type == null){
QuestInterface inter = questData.quest.questInterface;
if(inter.isPartyCompleted(party)){
if((!questData.isCompleted && questData.quest.completion == EnumQuestCompletion.Npc) || questData.quest.instantPartyComplete(party)){