[1.21.5 0.16.14 JAVA_21]
I'm trying to get a GameProfile, by UUID. (Slightly different than yesterday, where I wanted a UUID from a name.)
----------------------------------------------------------------------------------------------------------------
Idea 1
This function always* return null from the isPresent() check.
* It does not return null only if the user has been otherwise discovered elsewhere.
public static GameProfile getGameProfileFromUUID(UUID uuid) {
UserCache userCache = server.getUserCache();
if(userCache == null) {
return null;
}
Optional<GameProfile> potentialGameProfile = userCache.getByUuid(uuid);
if( !potentialGameProfile.isPresent() ) {
return null;
}
return potentialGameProfile.get();
}
Idea 2
server.getGameProfileRepo().findProfileByName(name);
doesn't apply here since I'm (approximately) trying to do that in reverse.
Idea 3
ProfileResult temp = server.getSessionService().fetchProfile(uuid, true); //true or false
String name = (temp == null ? "null" : temp.profile().getName() );
Always returns "null" (I'm testing for a known account, "Notch": "069a79f4-44e9-4726-a5be-fca90e38aaf5").
Note: I am connected to the internet (well) on my development device.
This was the only idea that we ended up talking about before @ #mod-dev-2 message .
TL;DR: (auth) client is null, not sure if this is normal but the apiService initialized before worlds (where I tail-call this), so it should be normal?
----------------------------------------------------------------------------------------------------------------
I believe I'm looking in the right places but am failing to get anything to work.