Class GameProfileCache

java.lang.Object
net.minecraft.server.players.GameProfileCache

public class GameProfileCache extends Object
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • GAMEPROFILES_MRU_LIMIT

      private static final int GAMEPROFILES_MRU_LIMIT
      See Also:
    • GAMEPROFILES_EXPIRATION_MONTHS

      private static final int GAMEPROFILES_EXPIRATION_MONTHS
      See Also:
    • usesAuthentication

      private static boolean usesAuthentication
    • profilesByName

      private final Map<String,GameProfileCache.GameProfileInfo> profilesByName
      A map between player usernames and
    • profilesByUUID

      private final Map<UUID,GameProfileCache.GameProfileInfo> profilesByUUID
      A map between and
    • requests

      private final Map<String,CompletableFuture<Optional<com.mojang.authlib.GameProfile>>> requests
    • profileRepository

      private final com.mojang.authlib.GameProfileRepository profileRepository
    • gson

      private final com.google.gson.Gson gson
    • file

      private final File file
    • operationCount

      private final AtomicLong operationCount
    • executor

      @Nullable private Executor executor
  • Constructor Details

    • GameProfileCache

      public GameProfileCache(com.mojang.authlib.GameProfileRepository p_10974_, File p_10975_)
  • Method Details

    • safeAdd

      private void safeAdd(GameProfileCache.GameProfileInfo p_10980_)
    • lookupGameProfile

      private static Optional<com.mojang.authlib.GameProfile> lookupGameProfile(com.mojang.authlib.GameProfileRepository p_10994_, String p_10995_)
    • createUnknownProfile

      private static Optional<com.mojang.authlib.GameProfile> createUnknownProfile(String pProfileName)
    • setUsesAuthentication

      public static void setUsesAuthentication(boolean pOnlineMode)
    • usesAuthentication

      private static boolean usesAuthentication()
    • add

      public void add(com.mojang.authlib.GameProfile p_10992_)
    • getNextOperation

      private long getNextOperation()
    • get

      public Optional<com.mojang.authlib.GameProfile> get(String pName)
      Get a player's GameProfile given their username. Mojang's servers will be contacted if the entry is not cached locally.
    • getAsync

      public CompletableFuture<Optional<com.mojang.authlib.GameProfile>> getAsync(String pName)
    • get

      public Optional<com.mojang.authlib.GameProfile> get(UUID pUuid)
      Parameters:
      pUuid - Get a player's GameProfile given their UUID
    • setExecutor

      public void setExecutor(Executor pExectutor)
    • clearExecutor

      public void clearExecutor()
    • createDateFormat

      private static DateFormat createDateFormat()
    • load

    • save

      public void save()
    • getTopMRUProfiles

      private Stream<GameProfileCache.GameProfileInfo> getTopMRUProfiles(int pLimit)
    • writeGameProfile

      private static com.google.gson.JsonElement writeGameProfile(GameProfileCache.GameProfileInfo p_10982_, DateFormat p_10983_)
    • readGameProfile

      private static Optional<GameProfileCache.GameProfileInfo> readGameProfile(com.google.gson.JsonElement p_10989_, DateFormat p_10990_)