Search in sources :

Example 1 with SingleProfileLookupCallback

use of org.spongepowered.common.profile.callback.SingleProfileLookupCallback in project SpongeCommon by SpongePowered.

the class MixinPlayerProfileCache method lookupByName.

@Override
public Optional<GameProfile> lookupByName(String name) {
    SingleProfileLookupCallback callback = new SingleProfileLookupCallback();
    SpongeImpl.getServer().getGameProfileRepository().findProfilesByNames(new String[] { name }, Agent.MINECRAFT, callback);
    Optional<GameProfile> profile = callback.getResult();
    if (profile.isPresent()) {
        this.addEntry((com.mojang.authlib.GameProfile) profile.get(), null);
    }
    return profile;
}
Also used : GameProfile(org.spongepowered.api.profile.GameProfile) SingleProfileLookupCallback(org.spongepowered.common.profile.callback.SingleProfileLookupCallback)

Aggregations

GameProfile (org.spongepowered.api.profile.GameProfile)1 SingleProfileLookupCallback (org.spongepowered.common.profile.callback.SingleProfileLookupCallback)1