Skip to content

Instantly share code, notes, and snippets.

@EdGruberman
Created June 20, 2011 16:57
Show Gist options
  • Save EdGruberman/1035990 to your computer and use it in GitHub Desktop.
Save EdGruberman/1035990 to your computer and use it in GitHub Desktop.
getPlayer
/**
* Returns player only if it is a full and case insensitive name match.
*
* @param name Name of player.
* @return Player that matches name.
*/
static Player getExactPlayer(String name) {
Player player = Bukkit.getServer().getPlayer(name);
if (player == null) return null;
if (!player.getName().equalsIgnoreCase(name)) return null;
return player;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment