From e2b897908cc6429706060b1dabecb2ac06f74215 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Tue, 27 Jan 2015 14:34:28 -0500 Subject: [PATCH] Recorrection d'un bug de synchronisation dans l'analyse auto-AFK --- .../java/plugin/pandacraftutils/modules/AfkManager.java | 2 +- .../plugin/pandacraftutils/players/OnlinePlayerManager.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AfkManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AfkManager.java index 0fb8799..cb8c1ab 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AfkManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AfkManager.java @@ -54,7 +54,7 @@ public class AfkManager extends BukkitRunnable implements Listener { public void run() { // methode exécutée toute les secondes Collection oPlayers = OnlinePlayerManager.getInstance().getAll(); - for (OnlinePlayer ap : oPlayers) + for (OnlinePlayer ap : oPlayers.toArray(new OnlinePlayer[oPlayers.size()])) { // parcours de tout les joueurs if (ap == null) continue; diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java index 596d560..d01706c 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java @@ -1,7 +1,6 @@ package net.mc_pandacraft.java.plugin.pandacraftutils.players; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils; @@ -81,7 +80,7 @@ public final class OnlinePlayerManager implements Listener { } public Collection getAll() { - return Collections.unmodifiableCollection(players.values()); + return players.values(); }