net.minecraft.server.management.PlayerProfileCache Java Examples

The following examples show how to use net.minecraft.server.management.PlayerProfileCache. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServerUtils.java    From CodeChickenLib with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static GameProfile getGameProfile(String username) {
    PlayerEntity player = getPlayer(username);
    if (player != null) {
        return player.getGameProfile();
    }

    //try and access it in the cache without forcing a save
    username = username.toLowerCase(Locale.ROOT);
    PlayerProfileCache.ProfileEntry cachedEntry = getServer().getPlayerProfileCache().usernameToProfileEntryMap.get(username);
    if (cachedEntry != null) {
        return cachedEntry.getGameProfile();
    }

    //load it from the cache
    return getServer().getPlayerProfileCache().getGameProfileForUsername(username);
}
 
Example #2
Source File: MixinIntegratedServer.java    From litematica with GNU Lesser General Public License v3.0 4 votes vote down vote up
private MixinIntegratedServer(File anvilFileIn, Proxy proxyIn, DataFixer dataFixerIn,
        YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn,
        GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    super(anvilFileIn, proxyIn, dataFixerIn, authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
}