Recorrection d'un bug de synchronisation dans l'analyse auto-AFK

This commit is contained in:
Marc Baloup 2015-01-27 14:34:28 -05:00
parent b01ffd8bcb
commit e2b897908c
2 changed files with 2 additions and 3 deletions

View File

@ -54,7 +54,7 @@ public class AfkManager extends BukkitRunnable implements Listener {
public void run() { public void run() {
// methode exécutée toute les secondes // methode exécutée toute les secondes
Collection<OnlinePlayer> oPlayers = OnlinePlayerManager.getInstance().getAll(); Collection<OnlinePlayer> oPlayers = OnlinePlayerManager.getInstance().getAll();
for (OnlinePlayer ap : oPlayers) for (OnlinePlayer ap : oPlayers.toArray(new OnlinePlayer[oPlayers.size()]))
{ // parcours de tout les joueurs { // parcours de tout les joueurs
if (ap == null) if (ap == null)
continue; continue;

View File

@ -1,7 +1,6 @@
package net.mc_pandacraft.java.plugin.pandacraftutils.players; package net.mc_pandacraft.java.plugin.pandacraftutils.players;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils; import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils;
@ -81,7 +80,7 @@ public final class OnlinePlayerManager implements Listener {
} }
public Collection<OnlinePlayer> getAll() { public Collection<OnlinePlayer> getAll() {
return Collections.unmodifiableCollection(players.values()); return players.values();
} }