Beispiel #1
0
 @Override
 public Player[] getOnlinePlayers() {
   List<Player> players = new ArrayList<Player>();
   for (Object i : theServer.getConfigurationManager().playerEntityList) {
     players.add(CraftPlayerCache.getCraftPlayer((EntityPlayerMP) i));
   }
   return players.toArray(new Player[0]);
 }
Beispiel #2
0
 @Override
 public Player getPlayer(String name) {
   // Player j;
   name = name.toLowerCase();
   for (Object i : configMan.playerEntityList) {
     EntityPlayerMP guy = (EntityPlayerMP) i;
     if (guy.username.toLowerCase().startsWith(name)) {
       CraftPlayer ply =
           CraftPlayerCache.getCraftPlayer(guy); // (Player) CraftEntity.getEntity(this, guy);
       return ply;
     }
   }
   // return (Player) configMan.getPlayerForUsername(name);
   return null;
 }