Maybe fixed party

This commit is contained in:
2022-02-14 01:25:51 +01:00
parent 777415f97e
commit 2b77607072
2 changed files with 8 additions and 3 deletions
@@ -14,7 +14,7 @@ public class Party {
private UUID ownerUuid;
private String partyName;
private String partyPassword;
private static ArrayList<PartyUser> partyUsers;
private final ArrayList<PartyUser> partyUsers;
public Party(int partyId, UUID ownerUuid, String partyName, String partyPassword) {
this.partyId = partyId;
@@ -29,6 +29,9 @@ public class Party {
}
public void addUser(ChatUser chatUser, String playerName) {
Party party = PartyManager.getParty(chatUser.getPartyId());
if (party != null)
party.removeUser(chatUser);
partyUsers.add(new PartyUser(chatUser.getUuid(), chatUser.getDisplayName(), playerName));
chatUser.setPartyId(getPartyId());
Queries.addPartyUser(chatUser);