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 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 getAll() { - return players.values(); + return Collections.unmodifiableCollection(players.values()); }