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 ce80d16..0dbcec6 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayerManager.java @@ -53,13 +53,13 @@ public final class OnlinePlayerManager { // ---------------------------------------- // -------------- Evènements -------------- // ---------------------------------------- - public void onPlayerJoin (PlayerJoinEvent event) + public synchronized void onPlayerJoin (PlayerJoinEvent event) { players.put(event.getPlayer(), new OnlinePlayer(event.getPlayer())); } - public void onPlayerQuit (PlayerQuitEvent event) + public synchronized void onPlayerQuit (PlayerQuitEvent event) { players.remove(event.getPlayer()); } @@ -74,16 +74,16 @@ public final class OnlinePlayerManager { - public static OnlinePlayer get(Player p) { + public synchronized static OnlinePlayer get(Player p) { return getInstance().players.get(p); } - public static Collection getAll() { + public synchronized static Collection getAll() { return new ArrayList(getInstance().players.values()); } - public static boolean isOnline(Player p) { + public synchronized static boolean isOnline(Player p) { return getInstance().players.containsKey(p); }