Package net.minecraft.server.players
Class GameProfileCache
java.lang.Object
net.minecraft.server.players.GameProfileCache
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Executorprivate final Fileprivate static final intprivate static final intprivate final Gsonprivate static final org.slf4j.Loggerprivate final AtomicLongprivate final com.mojang.authlib.GameProfileRepositoryprivate final Map<String, GameProfileCache.GameProfileInfo> A map between player usernames andprivate final Map<UUID, GameProfileCache.GameProfileInfo> A map between andprivate final Map<String, CompletableFuture<Optional<com.mojang.authlib.GameProfile>>> private static boolean -
Constructor Summary
ConstructorsConstructorDescriptionGameProfileCache(com.mojang.authlib.GameProfileRepository pProfileRepository, File pFile) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(com.mojang.authlib.GameProfile pGameProfile) Add an entry to this cachevoidprivate static DateFormatprivate static Optional<com.mojang.authlib.GameProfile> createUnknownProfile(String pProfileName) Optional<com.mojang.authlib.GameProfile> Get a player's GameProfile given their username.Optional<com.mojang.authlib.GameProfile> CompletableFuture<Optional<com.mojang.authlib.GameProfile>> private longprivate Stream<GameProfileCache.GameProfileInfo> getTopMRUProfiles(int pLimit) load()private static Optional<com.mojang.authlib.GameProfile> lookupGameProfile(com.mojang.authlib.GameProfileRepository pProfileRepo, String pName) private static Optional<GameProfileCache.GameProfileInfo> readGameProfile(JsonElement pJson, DateFormat pDateFormat) private voidsafeAdd(GameProfileCache.GameProfileInfo p_10980_) voidsave()voidsetExecutor(Executor pExectutor) static voidsetUsesAuthentication(boolean pOnlineMode) private static booleanprivate static JsonElementwriteGameProfile(GameProfileCache.GameProfileInfo pProfileInfo, DateFormat pDateFormat)
-
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
A map between player usernames and -
profilesByUUID
A map between and -
requests
-
profileRepository
private final com.mojang.authlib.GameProfileRepository profileRepository -
gson
-
file
-
operationCount
-
executor
-
-
Constructor Details
-
GameProfileCache
-
-
Method Details
-
safeAdd
-
lookupGameProfile
-
createUnknownProfile
-
setUsesAuthentication
public static void setUsesAuthentication(boolean pOnlineMode) -
usesAuthentication
private static boolean usesAuthentication() -
add
public void add(com.mojang.authlib.GameProfile pGameProfile) Add an entry to this cache -
getNextOperation
private long getNextOperation() -
get
Get a player's GameProfile given their username. Mojang's servers will be contacted if the entry is not cached locally. -
getAsync
-
get
- Parameters:
pUuid- Get a player'sGameProfilegiven their UUID
-
setExecutor
-
clearExecutor
public void clearExecutor() -
createDateFormat
-
load
-
save
public void save() -
getTopMRUProfiles
-
writeGameProfile
private static JsonElement writeGameProfile(GameProfileCache.GameProfileInfo pProfileInfo, DateFormat pDateFormat) -
readGameProfile
private static Optional<GameProfileCache.GameProfileInfo> readGameProfile(JsonElement pJson, DateFormat pDateFormat)
-