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;
}
Aggregations