Package net.minecraft.server.players
Class CachedUserNameToIdResolver
java.lang.Object
net.minecraft.server.players.CachedUserNameToIdResolver
- All Implemented Interfaces:
UserNameToIdResolver
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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, CachedUserNameToIdResolver.GameProfileInfo> private final Map<UUID, CachedUserNameToIdResolver.GameProfileInfo> private boolean -
Constructor Summary
ConstructorsConstructorDescriptionCachedUserNameToIdResolver(com.mojang.authlib.GameProfileRepository pProfileRepository, File pFile) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInternal(NameAndId pNameAndId) private static DateFormatcreateUnknownProfile(String pUsername) private longgetTopMRUProfiles(int pCount) load()lookupGameProfile(com.mojang.authlib.GameProfileRepository pProfileRepository, String pUsername) private static Optional<CachedUserNameToIdResolver.GameProfileInfo> readGameProfile(JsonElement pJson, DateFormat pFormat) voidresolveOfflineUsers(boolean p_435710_) private voidsafeAdd(CachedUserNameToIdResolver.GameProfileInfo pProfileInfo) voidsave()private static JsonElementwriteGameProfile(CachedUserNameToIdResolver.GameProfileInfo pProfile, DateFormat pFormat)
-
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:
-
resolveOfflineUsers
private boolean resolveOfflineUsers -
profilesByName
-
profilesByUUID
-
profileRepository
private final com.mojang.authlib.GameProfileRepository profileRepository -
gson
-
file
-
operationCount
-
-
Constructor Details
-
CachedUserNameToIdResolver
public CachedUserNameToIdResolver(com.mojang.authlib.GameProfileRepository pProfileRepository, File pFile)
-
-
Method Details
-
safeAdd
-
lookupGameProfile
-
createUnknownProfile
-
resolveOfflineUsers
public void resolveOfflineUsers(boolean p_435710_) - Specified by:
resolveOfflineUsersin interfaceUserNameToIdResolver
-
add
- Specified by:
addin interfaceUserNameToIdResolver
-
addInternal
-
getNextOperation
private long getNextOperation() -
get
- Specified by:
getin interfaceUserNameToIdResolver
-
get
- Specified by:
getin interfaceUserNameToIdResolver
-
createDateFormat
-
load
-
save
public void save()- Specified by:
savein interfaceUserNameToIdResolver
-
getTopMRUProfiles
-
writeGameProfile
private static JsonElement writeGameProfile(CachedUserNameToIdResolver.GameProfileInfo pProfile, DateFormat pFormat) -
readGameProfile
private static Optional<CachedUserNameToIdResolver.GameProfileInfo> readGameProfile(JsonElement pJson, DateFormat pFormat)
-