From a7bb84be0b33e847a0f5ca00b51d06e61dc7c7de Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 19 Aug 2014 21:24:49 -0500 Subject: [PATCH] Revert chris' revert --- .../src/mineplex/core/common/util/UtilServer.java | 2 +- .../src/mineplex/core/account/CoreClientManager.java | 2 +- .../Mineplex.Core/src/mineplex/core/antihack/AntiHack.java | 2 +- .../Mineplex.Core/src/mineplex/core/friend/FriendManager.java | 2 +- Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java | 2 +- .../src/mineplex/core/status/ServerStatusManager.java | 4 ++-- Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java | 2 +- .../src/nautilus/game/arcade/ArcadeManager.java | 2 +- .../game/games/sneakyassassins/powerups/PowerUpManager.java | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java index 443b37e34..bfb69d72c 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java @@ -9,7 +9,7 @@ public class UtilServer { public static Player[] getPlayers() { - return getServer().getOnlinePlayers(); + return getServer().getOnlinePlayers().toArray(new Player[0]); } public static Server getServer() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java index 98fea4f14..538d901a9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java @@ -217,7 +217,7 @@ public class CoreClientManager extends MiniPlugin client.SetPlayer(event.getPlayer()); // Reserved Slot Check - if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers()) + if (Bukkit.getOnlinePlayers().size() >= Bukkit.getServer().getMaxPlayers()) { if (client.GetRank().Has(event.getPlayer(), Rank.ULTRA, false)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index e5f1d14d5..66b107d9d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -357,7 +357,7 @@ public class AntiHack extends MiniPlugin UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement.")); - ServerListPingEvent event = new ServerListPingEvent(null, Bukkit.getServer().getMotd(), Bukkit.getServer().getOnlinePlayers().length, Bukkit.getServer().getMaxPlayers()); + ServerListPingEvent event = new ServerListPingEvent(null, Bukkit.getServer().getMotd(), Bukkit.getServer().getOnlinePlayers().size(), Bukkit.getServer().getMaxPlayers()); GetPluginManager().callEvent(event); String motd = event.getMotd(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java index 53010bdf2..6bde47c27 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java @@ -94,7 +94,7 @@ public class FriendManager extends MiniClientPlugin implements IPack @EventHandler public void updateFriends(UpdateEvent event) { - if (event.getType() != UpdateType.SLOW || Bukkit.getOnlinePlayers().length == 0) + if (event.getType() != UpdateType.SLOW || Bukkit.getOnlinePlayers().size() == 0) return; Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java index 44d7de506..1c99c7134 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java @@ -153,7 +153,7 @@ public class Portal extends MiniPlugin @EventHandler public void checkForServerTransfers(UpdateEvent event) { - if (event.getType() != UpdateType.SEC || Bukkit.getOnlinePlayers().length == 0) + if (event.getType() != UpdateType.SEC || Bukkit.getOnlinePlayers().size() == 0) return; _retrieve = !_retrieve; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java index 0e7cf59f7..227e4cbfb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java @@ -131,11 +131,11 @@ public class ServerStatusManager extends MiniPlugin */ private MinecraftServer generateServerSnapshot() { - ServerListPingEvent event = new ServerListPingEvent(null, GetPlugin().getServer().getMotd(), GetPlugin().getServer().getOnlinePlayers().length, GetPlugin().getServer().getMaxPlayers()); + ServerListPingEvent event = new ServerListPingEvent(null, GetPlugin().getServer().getMotd(), GetPlugin().getServer().getOnlinePlayers().size(), GetPlugin().getServer().getMaxPlayers()); GetPluginManager().callEvent(event); String motd = event.getMotd(); - int playerCount = Bukkit.getOnlinePlayers().length; + int playerCount = Bukkit.getOnlinePlayers().size(); int maxPlayerCount = event.getMaxPlayers(); int tps = (int) _lagMeter.getTicksPerSecond(); String address = Bukkit.getServer().getIp().isEmpty() ? "localhost" : Bukkit.getServer().getIp(); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index b46c0a1cf..63ded0915 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -447,7 +447,7 @@ public class HubManager extends MiniClientPlugin CoreClient client = _clientManager.Get(event.getPlayer().getName()); // Reserved Slot Check - if (Bukkit.getOnlinePlayers().length - Bukkit.getServer().getMaxPlayers() >= 20) + if (Bukkit.getOnlinePlayers().size() - Bukkit.getServer().getMaxPlayers() >= 20) { if (!client.GetRank().Has(Rank.ULTRA)) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 962c3f4c5..1e01d1475 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -565,7 +565,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation } // Reserved Slot Check - if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers()) + if (Bukkit.getOnlinePlayers().size() >= Bukkit.getServer().getMaxPlayers()) { if (_serverStatusManager.getCurrentServerName().contains("BETA")) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java index edb220a3d..a14246b6e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/PowerUpManager.java @@ -226,7 +226,7 @@ public class PowerUpManager implements Listener if (getGame().GetState() != GameState.Live) return; - Player[] players = Bukkit.getOnlinePlayers(); + Collection players = Bukkit.getOnlinePlayers(); for (Player player : players) {