Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     /**
  2.      * Returns player only if it is a full and case insensitive name match.
  3.      *
  4.      * @param name Name of player.
  5.      * @return Player that matches name.
  6.      */
  7.     static Player getExactPlayer(String name) {
  8.         Player player = Bukkit.getServer().getPlayer(name);
  9.         if (player == null) return null;
  10.        
  11.         if (!player.getName().equalsIgnoreCase(name)) return null;
  12.        
  13.         return player;
  14.     }