From 9c09c168f8d2507e907de399da857c7d792d240e Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Fri, 15 Feb 2013 12:32:35 +0100 Subject: [PATCH] Fix a ConcurrentModificationException --- .../com/gmail/nossr50/party/runnables/PartyAutoKick.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/party/runnables/PartyAutoKick.java b/src/main/java/com/gmail/nossr50/party/runnables/PartyAutoKick.java index 56e5ebfa0..aff2886bc 100644 --- a/src/main/java/com/gmail/nossr50/party/runnables/PartyAutoKick.java +++ b/src/main/java/com/gmail/nossr50/party/runnables/PartyAutoKick.java @@ -1,5 +1,7 @@ package com.gmail.nossr50.party.runnables; +import java.util.ArrayList; + import org.bukkit.OfflinePlayer; import com.gmail.nossr50.config.Config; @@ -16,8 +18,8 @@ public class PartyAutoKick implements Runnable { long currentTime = System.currentTimeMillis(); long kickTime = 24L * 60L * 60L * 1000L * Config.getInstance().getAutoPartyKickTime(); - for (Party party : PartyManager.getParties()) { - for (OfflinePlayer member : party.getMembers()) { + for (Party party : new ArrayList(PartyManager.getParties())) { + for (OfflinePlayer member : new ArrayList(party.getMembers())) { if (currentTime - member.getLastPlayed() > kickTime) { PartyManager.removeFromParty(member, party); }