From 47dcc62d4fe41eedced24363f81942147a6ba624 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 7 Mar 2024 04:50:10 -0500 Subject: [PATCH] Fix QuestPing and Automatic Quest Checker --- .../client/gui/player/inventory/GuiParty.java | 28 ++++++++++--------- .../npcs/controllers/PartyController.java | 3 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiParty.java b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiParty.java index 08739d667..1c307335b 100644 --- a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiParty.java +++ b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiParty.java @@ -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(); diff --git a/src/main/java/noppes/npcs/controllers/PartyController.java b/src/main/java/noppes/npcs/controllers/PartyController.java index e8bc492f9..a890e53b0 100644 --- a/src/main/java/noppes/npcs/controllers/PartyController.java +++ b/src/main/java/noppes/npcs/controllers/PartyController.java @@ -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 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)){