Send Party Members to Client

This commit is contained in:
Kam committed 2025-06-23 23:48:35 -04:00
1 parent 70f146cb27
commit 6a21edb46b
1 file changed
+18
@@ -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;
}
}