diff --git a/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java b/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java index d4f8e485d..5609d6b8c 100644 --- a/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java @@ -1,7 +1,9 @@ package com.gmail.nossr50.runnables.party; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map.Entry; import org.bukkit.OfflinePlayer; @@ -20,6 +22,7 @@ public class PartyAutoKickTask extends BukkitRunnable { private void updatePartyMembers() { HashMap toRemove = new HashMap(); + List processedPlayers = new ArrayList(); long currentTime = System.currentTimeMillis(); long kickTime = 24L * 60L * 60L * 1000L * Config.getInstance().getAutoPartyKickTime(); @@ -30,9 +33,13 @@ public class PartyAutoKickTask extends BukkitRunnable { for (String memberName : party.getMembers()) { OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberName); - if (currentTime - member.getLastPlayed() > kickTime) { + if ((currentTime - member.getLastPlayed() > kickTime) || processedPlayers.contains(memberName)) { toRemove.put(member, party); } + + if (!processedPlayers.contains(memberName)) { + processedPlayers.add(memberName); + } } }