Fix a ConcurrentModificationException

This commit is contained in:
TfT_02 2013-02-15 12:32:35 +01:00
parent c61e710341
commit 9c09c168f8

View File

@ -1,5 +1,7 @@
package com.gmail.nossr50.party.runnables; package com.gmail.nossr50.party.runnables;
import java.util.ArrayList;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
@ -16,8 +18,8 @@ public class PartyAutoKick implements Runnable {
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
long kickTime = 24L * 60L * 60L * 1000L * Config.getInstance().getAutoPartyKickTime(); long kickTime = 24L * 60L * 60L * 1000L * Config.getInstance().getAutoPartyKickTime();
for (Party party : PartyManager.getParties()) { for (Party party : new ArrayList<Party>(PartyManager.getParties())) {
for (OfflinePlayer member : party.getMembers()) { for (OfflinePlayer member : new ArrayList<OfflinePlayer>(party.getMembers())) {
if (currentTime - member.getLastPlayed() > kickTime) { if (currentTime - member.getLastPlayed() > kickTime) {
PartyManager.removeFromParty(member, party); PartyManager.removeFromParty(member, party);
} }