Fixes Parties throwing an error when players log out

This commit is contained in:
Jules 2024-09-07 18:07:53 +02:00
parent cdfbb6ef09
commit 88760db078

View File

@ -2,7 +2,7 @@ package net.Indyuce.mmocore.party.compat;
import com.alessiodp.parties.api.Parties; import com.alessiodp.parties.api.Parties;
import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostJoinEvent; import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostJoinEvent;
import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostLeaveEvent; import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPreLeaveEvent;
import com.alessiodp.parties.api.interfaces.PartiesAPI; import com.alessiodp.parties.api.interfaces.PartiesAPI;
import com.alessiodp.parties.api.interfaces.Party; import com.alessiodp.parties.api.interfaces.Party;
import com.alessiodp.parties.api.interfaces.PartyPlayer; import com.alessiodp.parties.api.interfaces.PartyPlayer;
@ -44,7 +44,7 @@ public class PartiesPartyModule implements PartyModule, Listener {
} }
@EventHandler @EventHandler
public void onPlayerLeave(BukkitPartiesPlayerPostLeaveEvent event) { public void onPlayerLeave(BukkitPartiesPlayerPreLeaveEvent event) {
int membersSize = event.getParty().getMembers().size(); int membersSize = event.getParty().getMembers().size();
PartyUtils.clearStatBonuses(PlayerData.get(event.getPartyPlayer().getPlayerUUID())); PartyUtils.clearStatBonuses(PlayerData.get(event.getPartyPlayer().getPlayerUUID()));
event.getParty().getOnlineMembers() event.getParty().getOnlineMembers()