mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fix a ConcurrentModificationException
This commit is contained in:
parent
c61e710341
commit
9c09c168f8
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user