private static CommandSender getSender(String sender) { if (sender != null) { GSPlayer p = PlayerManager.getPlayer(sender); return (p == null ? ProxyServer.getInstance().getConsole() : p.getProxiedPlayer()); } return null; }
public static GSPlayer getSimilarPlayer(String player) { for (GSPlayer p : onlinePlayers.values()) { if ((p.getProxiedPlayer() != null && p.getProxiedPlayer().getDisplayName() != null && p.getProxiedPlayer() .getDisplayName() .toLowerCase() .startsWith(player.toLowerCase())) || p.getName().toLowerCase().startsWith(player.toLowerCase()) || (p.getUuid() != null && p.getUuid().equals(player))) { return p; } } return null; }
public static List<GSPlayer> getPlayersByIP(String ip) { List<GSPlayer> matchingPlayers = new ArrayList<GSPlayer>(); if (ip == null) { Exception exception = new Exception("test"); exception.printStackTrace(); geSuit.instance.getLogger().severe("getPlayersByIP() ip is null"); return null; } for (GSPlayer p : onlinePlayers.values()) { if (p.getProxiedPlayer().getAddress().getHostString().equalsIgnoreCase(ip)) { matchingPlayers.add(p); } } return matchingPlayers; }
public static void sendMessageToTarget(GSPlayer target, String message) { sendMessageToTarget(target.getProxiedPlayer(), message); }