Use fetched GameProfile for getOfflinePlayer(String)
When getting an OfflinePlayer by name we lookup their UUID and then use that to fetch the OfflinePlayer. If the player has not played on this server before the resulting OfflinePlayer will return null for getName(). As this is unintuitive we now create the OfflinePlayer directly using the profile we looked up and make OfflinePlayer prefer that data. By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
@@ -49,6 +49,11 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
||||
return player.getName();
|
||||
}
|
||||
|
||||
// This might not match lastKnownName but if not it should be more correct
|
||||
if (profile.getName() != null) {
|
||||
return profile.getName();
|
||||
}
|
||||
|
||||
NBTTagCompound data = getBukkitData();
|
||||
|
||||
if (data != null) {
|
||||
|
||||
Reference in New Issue
Block a user