コード例 #1
0
ファイル: CraftServer.java プロジェクト: wmchris/BukkitForge
 @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]);
 }
コード例 #2
0
ファイル: CraftServer.java プロジェクト: wmchris/BukkitForge
 @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;
 }