From 897b307035f77b9a7e1070bcedecc5e8b45b2df2 Mon Sep 17 00:00:00 2001
From: Marc Baloup <marc.baloup@laposte.net>
Date: Sun, 25 Jan 2015 14:34:47 -0500
Subject: [PATCH] Correction d'un bug de Synchronisation

---
 .../java/plugin/pandacraftutils/modules/AfkManager.java      | 5 ++++-
 .../plugin/pandacraftutils/players/OnlinePlayerManager.java  | 3 ++-
 2 files changed, 6 insertions(+), 2 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 acfe9f8..0fb8799 100644
--- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AfkManager.java
+++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AfkManager.java
@@ -1,6 +1,8 @@
 package net.mc_pandacraft.java.plugin.pandacraftutils.modules;
 
 
+import java.util.Collection;
+
 import net.mc_pandacraft.java.plugin.pandacraftutils.ConfigManager;
 import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils;
 import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayer;
@@ -51,7 +53,8 @@ public class AfkManager extends BukkitRunnable implements Listener  {
 	@Override
 	public void run() {
 		// methode exécutée toute les secondes
-		for (OnlinePlayer ap : OnlinePlayerManager.getInstance().getAll())
+		Collection<OnlinePlayer> oPlayers = OnlinePlayerManager.getInstance().getAll();
+		for (OnlinePlayer ap : oPlayers)
 		{	// 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 d01706c..596d560 100644
--- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java
+++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java
@@ -1,6 +1,7 @@
 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;
@@ -80,7 +81,7 @@ public final class OnlinePlayerManager implements Listener {
 	}
 	
 	public Collection<OnlinePlayer> getAll() {
-		return players.values();
+		return Collections.unmodifiableCollection(players.values());
 	}