public static CraftPlayer getCraftPlayer(EntityPlayerMP player) {
   if (playerCache.containsKey(player.username.toLowerCase())) {
     CraftPlayer ply = playerCache.get(player.username.toLowerCase());
     if (ply.getHandle().isDead) {
       ply.setHandle(player);
       return ply;
     } else {
       return ply;
     }
   }
   CraftPlayer ply = new CraftPlayer(player);
   playerCache.put(player.username.toLowerCase(), ply);
   return ply;
 }
Exemplo n.º 2
0
 public static void sendPacket(Player player, Packet packet) {
   ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
 }