mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-30 19:31:28 +01:00
Fixed concurrentModificationException
This commit is contained in:
parent
bbe2250e0a
commit
004748dbd3
@ -3,7 +3,7 @@ name: NoCheat
|
|||||||
author: Evenprime
|
author: Evenprime
|
||||||
|
|
||||||
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
||||||
version: 0.8.2
|
version: 0.8.3
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
nocheat:
|
nocheat:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat;
|
package cc.co.evenprime.bukkit.nocheat;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@ -103,10 +104,11 @@ public class NoCheat extends JavaPlugin {
|
|||||||
*/
|
*/
|
||||||
public void cleanPlayerDataCollection() {
|
public void cleanPlayerDataCollection() {
|
||||||
synchronized(playerData) {
|
synchronized(playerData) {
|
||||||
for(Player p : playerData.keySet()) {
|
Iterator<Map.Entry<Player, NoCheatData>> it = playerData.entrySet().iterator();
|
||||||
if(!p.isOnline()) {
|
while (it.hasNext()) {
|
||||||
playerData.remove(p);
|
Map.Entry<Player, NoCheatData> pairs = (Map.Entry<Player, NoCheatData>)it.next();
|
||||||
}
|
if(!pairs.getKey().isOnline())
|
||||||
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user