Bukkit/CraftBukkit — pull request #1289 by Black-Hole (2013-12-09 01:57:34+00:00)
Title: [B+C] Add player unique ID to AsyncPlayerPreLoginEvent. Adds BUKKIT-5108

The Issue:
Mojang is slowly migrating the the identification of players from their name to their unique ID. For plugins it could be useful to have this UniqueID in a very early state of the connection process.

Justification for this PR:
AsyncPlayerPreLoginEvent is called in a very early state of the connection process. So it would be best to add the UniqueID to AsyncPlayerPreLoginEvent.

PR Breakdown:
In ThreadPlayerLookupUUID.run() the GameProfile is verified. Until now CraftBukkit only uses the getName() method of the GameProfile. This PR translates the string representation of the UniqueID (GameProfile.getId()) to an UUID and passes that to the AsyncPlayerPreLoginEvent.
The deprecated PlayerPreLoginEvent is unaltered.

Testing Results and Materials:
Tested with adding debug code to one of my plugins. The UniqueID is always the same for the same player in calls of AsyncPlayerPreLoginEvent, PlayerLoginEvent and PlayerJoinEvent.

Relevant PR:
B-987 - https://github.com/Bukkit/Bukkit/pull/987

JIRA Ticket:
BUKKIT-5108 - https://bukkit.atlassian.net/browse/BUKKIT-5108