mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Deal with the ConcurrentModification issue. Fixes #873
This commit is contained in:
parent
3cf01cb6f3
commit
ca51b2f70f
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user