From 6a21edb46b7ad22af1c4e2e16ddbf312b9834255 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 23 Jun 2025 23:48:35 -0400 Subject: [PATCH] Send Party Members to Client --- .../noppes/npcs/controllers/data/Party.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/noppes/npcs/controllers/data/Party.java b/src/main/java/noppes/npcs/controllers/data/Party.java index df826bb9e..7a89e06c7 100644 --- a/src/main/java/noppes/npcs/controllers/data/Party.java +++ b/src/main/java/noppes/npcs/controllers/data/Party.java @@ -459,6 +459,15 @@ public class Party implements IParty { this.currentQuestID = compound.getInteger("PartyQuestID"); this.currentQuestName = compound.getString("PartyQuestName"); this.friendlyFire = compound.getBoolean("FriendlyFire"); + + NBTTagList list = compound.getTagList("PartyMembers", 10); + for (int i = 0; i < list.tagCount(); i++) { + NBTTagCompound tagCompound = list.getCompoundTagAt(i); + UUID uuid = UUID.fromString(tagCompound.getString("UUID")); + String playerName = tagCompound.getString("PlayerName"); + this.partyOrder.add(uuid); + this.partyMembers.put(uuid, playerName); + } } public NBTTagCompound writeClientNBT() { @@ -466,6 +475,15 @@ public class Party implements IParty { compound.setInteger("PartyQuestID", this.currentQuestID); compound.setString("PartyQuestName", this.currentQuestName); compound.setBoolean("FriendlyFire", this.friendlyFire); + + NBTTagList list = new NBTTagList(); + for (UUID uuid : this.partyOrder) { + NBTTagCompound uuidCompound = new NBTTagCompound(); + uuidCompound.setString("UUID", uuid.toString()); + uuidCompound.setString("PlayerName", this.partyMembers.get(uuid)); + list.appendTag(uuidCompound); + } + compound.setTag("PartyMembers", list); return compound; } }