Offline Players

In the javadocs there are two methods to retrieve a Player object from the server:

The method .getPlayer(String name) specifically states it is not able to retrieve offline players, however the .getPlayer(UUID id) does not say that. Does anyone know if getting a player via UUID works for offline players?

I know there is a pull request for GameProfile cache, but I am interested in this particular method at the moment.

they really need better documentation on that

right now, i think retrieval with UUID will help you get a Player object, maybe as a User, regardless of whether or not they’re online simply because its a UUID. UUIDs are what we use to record players as opposed to playernames. getPlayer(String name) probably won’t work for offline because having a name cache or retrieving player names just to find an offline player isn’t worth the memory usage and potential thread death from trying to call the nameserver.

tl;dr i’d assume getPlayer(UUID) will help you get an offline player. getPlayer(String) has its reason not to work for the former.

There is no such thing as an offline Player.class

There are GameProfiles, and Users which can be offline.

Users stores the data that get’s persisted in the player.dat files, GameProfile has skin and identity information.

User is very similar to Bukkit’s OfflinePlayer.

My profile cache PR also includes a UserStorage to get offline player data.

Feedback is needed on @boformer’s PR. This part of the API can be added faster if you provide some comments on it. Even just saying you approve of all the additions (after reviewing them of course) helps.