Deal with the ConcurrentModification issue. Fixes #873

This commit is contained in:
TfT_02 2013-03-26 15:18:06 +01:00
parent 3cf01cb6f3
commit ca51b2f70f

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.runnables.party; package com.gmail.nossr50.runnables.party;
import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@ -22,8 +23,7 @@ public class PartyAutoKickTask extends BukkitRunnable {
for (Iterator<Party> partyIterator = PartyManager.getParties().iterator(); partyIterator.hasNext();) { for (Iterator<Party> partyIterator = PartyManager.getParties().iterator(); partyIterator.hasNext();) {
Party party = partyIterator.next(); Party party = partyIterator.next();
for (Iterator<OfflinePlayer> memberIterator = party.getMembers().iterator(); memberIterator.hasNext();) { for (OfflinePlayer member : new ArrayList<OfflinePlayer>(party.getMembers())) {
OfflinePlayer member = memberIterator.next();
if (currentTime - member.getLastPlayed() > kickTime) { if (currentTime - member.getLastPlayed() > kickTime) {
PartyManager.removeFromParty(member, party); PartyManager.removeFromParty(member, party);