public List<String> getBannedPlayers() throws APIException { List<String> a = new ArrayList<String>(); for (OfflinePlayer p : Server.getBannedPlayers()) { a.add(p.getName()); } return a; }
public List<OfflinePlayer> opList() { List<OfflinePlayer> ops = new ArrayList<OfflinePlayer>(); for (OfflinePlayer p : Bukkit.getOfflinePlayers()) { if (p.isOp()) { ops.add(p); } } return ops; }
public List<OfflinePlayer> getOfflinePlayers() { List<OfflinePlayer> o = new ArrayList<OfflinePlayer>(); List<String> online = getPlayerNames(); for (OfflinePlayer p : Server.getOfflinePlayers()) { if (!online.contains(p.getName())) { o.add(p); } } return o; }
public List<String> getOfflinePlayerNames() { List<String> names = new ArrayList<String>(); List<String> online = getPlayerNames(); for (OfflinePlayer p : Server.getOfflinePlayers()) { if (!online.contains(p.getName())) { names.add(p.getName()); } } return names; }
public boolean deop(String playerName) { try { OfflinePlayer p = Bukkit.getOfflinePlayer(playerName); if (p.isOnline()) { p.getPlayer().sendMessage("You are no longer OP"); } p.setOp(false); return true; } catch (Exception e) { return false; } }