Fix party users not being removed correctly (they left the party but still had their party id set)
This commit is contained in:
parent
3e313cb00b
commit
fdd9d81400
|
|
@ -47,7 +47,9 @@ public class Party {
|
||||||
.filter(partyUser -> partyUser.getUuid().equals(uuid))
|
.filter(partyUser -> partyUser.getUuid().equals(uuid))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
if (first.isEmpty()) return;
|
if (first.isEmpty()) return;
|
||||||
partyUsers.remove(first.get());
|
PartyUser partyUser = first.get();
|
||||||
|
partyUsers.remove(partyUser);
|
||||||
|
chatUser.setPartyId(-1);
|
||||||
Queries.removePartyUser(uuid);
|
Queries.removePartyUser(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,13 +64,14 @@ public class Remove implements SubCommand {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
party.removeUser(ChatUserManager.getChatUser(partyUser.getUuid()));
|
|
||||||
|
|
||||||
if (partyUser.getUuid().equals(party.getOwnerUuid())) {
|
if (partyUser.getUuid().equals(party.getOwnerUuid())) {
|
||||||
source.sendMessage(Utility.parseMiniMessage(Config.CANT_REMOVE_PARTY_OWNER));
|
source.sendMessage(Utility.parseMiniMessage(Config.CANT_REMOVE_PARTY_OWNER));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
party.removeUser(ChatUserManager.getChatUser(partyUser.getUuid()));
|
||||||
|
|
||||||
|
|
||||||
if (onlinePlayer != null && onlinePlayer.isActive()) {
|
if (onlinePlayer != null && onlinePlayer.isActive()) {
|
||||||
onlinePlayer.sendMessage(Utility.parseMiniMessage(Config.REMOVED_FROM_PARTY,
|
onlinePlayer.sendMessage(Utility.parseMiniMessage(Config.REMOVED_FROM_PARTY,
|
||||||
Placeholder.unparsed("party", party.getPartyName())
|
Placeholder.unparsed("party", party.getPartyName())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user