mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 12:43:16 +00:00
Apply Universal QuestData to Party
This commit is contained in:
1 parent
3e0a2d29a3
commit
607b3f54d8
8 files changed
+253
-33
No files matched your search
@@ -104,23 +104,24 @@ public class PartyController {
|
||||
return;
|
||||
|
||||
NBTTagCompound compound = party.writeToNBT();
|
||||
if (party.getQuest() != null) {
|
||||
Quest quest = (Quest) party.getQuest();
|
||||
Vector<String> vector = quest.questInterface.getPartyQuestLogStatus(party);
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (String s : vector) {
|
||||
list.appendTag(new NBTTagString(s));
|
||||
}
|
||||
compound.setTag("QuestProgress", list);
|
||||
if(quest.completion == EnumQuestCompletion.Npc && quest.questInterface.isPartyCompleted(party)) {
|
||||
compound.setString("QuestCompleteWith", quest.completerNpc);
|
||||
}
|
||||
}
|
||||
|
||||
for(String name : party.getPlayerNames()){
|
||||
EntityPlayer playerMP = NoppesUtilServer.getPlayerByName(name);
|
||||
if(playerMP != null){
|
||||
PlayerData playerData = PlayerDataController.Instance.getPlayerData(playerMP);
|
||||
if(playerData != null){
|
||||
if (party.getQuest() != null) {
|
||||
Quest quest = (Quest) party.getQuest();
|
||||
Vector<String> vector = quest.questInterface.getQuestLogStatus(playerMP);
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (String s : vector) {
|
||||
list.appendTag(new NBTTagString(s));
|
||||
}
|
||||
compound.setTag("QuestProgress", list);
|
||||
if(quest.completion == EnumQuestCompletion.Npc && quest.questInterface.isCompleted(playerData)) {
|
||||
compound.setString("QuestCompleteWith", quest.completerNpc);
|
||||
}
|
||||
}
|
||||
Server.sendData((EntityPlayerMP) playerMP, EnumPacketClient.PARTY_DATA, compound);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.UUID;
|
||||
public class Party {
|
||||
private final UUID partyUUID;
|
||||
private UUID partyLeader;
|
||||
private QuestData questData;
|
||||
|
||||
private final HashMap<UUID, String> partyMembers = new HashMap<>();
|
||||
private final ArrayList<UUID> partyOrder = new ArrayList<>();
|
||||
@@ -60,11 +61,12 @@ public class Party {
|
||||
if (quest != null) {
|
||||
this.currentQuestID = quest.getId();
|
||||
this.currentQuestName = quest.getName();
|
||||
this.questData = new QuestData((Quest) quest);
|
||||
} else {
|
||||
this.currentQuestID = -1;
|
||||
this.currentQuestName = "";
|
||||
this.questData = null;
|
||||
}
|
||||
|
||||
this.partyLocked = quest != null;
|
||||
}
|
||||
|
||||
@@ -76,6 +78,10 @@ public class Party {
|
||||
}
|
||||
}
|
||||
|
||||
public QuestData getQuestData() {
|
||||
return questData;
|
||||
}
|
||||
|
||||
public int getCurrentQuestID() {
|
||||
return currentQuestID;
|
||||
}
|
||||
@@ -220,7 +226,7 @@ public class Party {
|
||||
sendInfoMessage(leader, "\u00A7aQuest set to party!");
|
||||
}
|
||||
else {
|
||||
sendInfoMessage(leader, "You are invalid for this quest");
|
||||
sendInfoMessage(leader, "\u00A7cYou are invalid for this quest");
|
||||
}
|
||||
return leaderBool;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user