Revert chris' revert
This commit is contained in:
parent
f60a818e6a
commit
a7bb84be0b
@ -9,7 +9,7 @@ public class UtilServer
|
|||||||
{
|
{
|
||||||
public static Player[] getPlayers()
|
public static Player[] getPlayers()
|
||||||
{
|
{
|
||||||
return getServer().getOnlinePlayers();
|
return getServer().getOnlinePlayers().toArray(new Player[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Server getServer()
|
public static Server getServer()
|
||||||
|
@ -217,7 +217,7 @@ public class CoreClientManager extends MiniPlugin
|
|||||||
client.SetPlayer(event.getPlayer());
|
client.SetPlayer(event.getPlayer());
|
||||||
|
|
||||||
// Reserved Slot Check
|
// 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))
|
if (client.GetRank().Has(event.getPlayer(), Rank.ULTRA, false))
|
||||||
{
|
{
|
||||||
|
@ -357,7 +357,7 @@ public class AntiHack extends MiniPlugin
|
|||||||
|
|
||||||
UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement."));
|
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);
|
GetPluginManager().callEvent(event);
|
||||||
|
|
||||||
String motd = event.getMotd();
|
String motd = event.getMotd();
|
||||||
|
@ -94,7 +94,7 @@ public class FriendManager extends MiniClientPlugin<FriendData> implements IPack
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void updateFriends(UpdateEvent event)
|
public void updateFriends(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.SLOW || Bukkit.getOnlinePlayers().length == 0)
|
if (event.getType() != UpdateType.SLOW || Bukkit.getOnlinePlayers().size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable()
|
Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable()
|
||||||
|
@ -153,7 +153,7 @@ public class Portal extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void checkForServerTransfers(UpdateEvent event)
|
public void checkForServerTransfers(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.SEC || Bukkit.getOnlinePlayers().length == 0)
|
if (event.getType() != UpdateType.SEC || Bukkit.getOnlinePlayers().size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_retrieve = !_retrieve;
|
_retrieve = !_retrieve;
|
||||||
|
@ -131,11 +131,11 @@ public class ServerStatusManager extends MiniPlugin
|
|||||||
*/
|
*/
|
||||||
private MinecraftServer generateServerSnapshot()
|
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);
|
GetPluginManager().callEvent(event);
|
||||||
|
|
||||||
String motd = event.getMotd();
|
String motd = event.getMotd();
|
||||||
int playerCount = Bukkit.getOnlinePlayers().length;
|
int playerCount = Bukkit.getOnlinePlayers().size();
|
||||||
int maxPlayerCount = event.getMaxPlayers();
|
int maxPlayerCount = event.getMaxPlayers();
|
||||||
int tps = (int) _lagMeter.getTicksPerSecond();
|
int tps = (int) _lagMeter.getTicksPerSecond();
|
||||||
String address = Bukkit.getServer().getIp().isEmpty() ? "localhost" : Bukkit.getServer().getIp();
|
String address = Bukkit.getServer().getIp().isEmpty() ? "localhost" : Bukkit.getServer().getIp();
|
||||||
|
@ -447,7 +447,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
CoreClient client = _clientManager.Get(event.getPlayer().getName());
|
CoreClient client = _clientManager.Get(event.getPlayer().getName());
|
||||||
|
|
||||||
// Reserved Slot Check
|
// 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))
|
if (!client.GetRank().Has(Rank.ULTRA))
|
||||||
{
|
{
|
||||||
|
@ -565,7 +565,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reserved Slot Check
|
// Reserved Slot Check
|
||||||
if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers())
|
if (Bukkit.getOnlinePlayers().size() >= Bukkit.getServer().getMaxPlayers())
|
||||||
{
|
{
|
||||||
if (_serverStatusManager.getCurrentServerName().contains("BETA"))
|
if (_serverStatusManager.getCurrentServerName().contains("BETA"))
|
||||||
{
|
{
|
||||||
|
@ -226,7 +226,7 @@ public class PowerUpManager implements Listener
|
|||||||
if (getGame().GetState() != GameState.Live)
|
if (getGame().GetState() != GameState.Live)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player[] players = Bukkit.getOnlinePlayers();
|
Collection<? extends Player> players = Bukkit.getOnlinePlayers();
|
||||||
|
|
||||||
for (Player player : players)
|
for (Player player : players)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user