Interface UserManager
- 
Method SummaryModifier and TypeMethodDescriptionDeletes the data associated with aUser, if the player is offline.booleanIf the implementation supports caching user objects, this will hint to the implementation that the user with the given UUID should be saved to the disk immediately.Gets the data of aUserby their last known user name (case-insensitive).Gets the data of aUserby their unique id.load(GameProfile profile) Gets the data of aUserby theirGameProfile.loadOrCreate(UUID uuid) Gets or creates a persistentUserwith the given UUID.booleanremoveFromCache(UUID uuid) If the implementation supports caching user objects, this will hint to the implementation that the user with the given UUID should no longer be cached.streamOfMatches(String lastKnownName) Gets aStreamthat returns aGameProfilefor each storedUserwhose last known user names start with the given string (case-insensitive).
- 
Method Details- 
loadGets the data of aUserby their unique id.- Parameters:
- uniqueId- The UUID of the user
- Returns:
- Useror Optional.empty() if not found
 
- 
loadGets the data of aUserby their last known user name (case-insensitive).To get the current name of a player, use the GameProfileManagerservice.- Parameters:
- lastKnownName- The user name
- Returns:
- Useror Optional.empty() if not found
 
- 
loadGets the data of aUserby theirGameProfile.- Parameters:
- profile- The profile
- Returns:
- Useror Optional.empty() if not found
 
- 
loadOrCreateGets or creates a persistentUserwith the given UUID.- Parameters:
- uuid- The- UUIDof the player to load or create.
- Returns:
- The user object
 
- 
deleteDeletes the data associated with aUser, if the player is offline.- Parameters:
- uuid- The uuid of the user to delete
- Returns:
- true if the deletion was successful
 
- 
removeFromCacheIf the implementation supports caching user objects, this will hint to the implementation that the user with the given UUID should no longer be cached. AnyUserobjects held that this point will become invalid (though developers should not be storing users).Be aware, any changes that have been made to the user may not be saved. Users that are online will not be affected by this call. - Parameters:
- uuid- The UUID of the user to save.
- Returns:
- trueif the user was removed from a cache.
 
- 
forceSaveIf the implementation supports caching user objects, this will hint to the implementation that the user with the given UUID should be saved to the disk immediately.If an exception is encountered during save, the completed future will be exceptional and the boolean will be null. It is therefore recommended that you check for any exceptions this future holds.- Parameters:
- uuid- The user to attempt to save.
- Returns:
- A completed future that returns trueif the implementation saved the user.
 
- 
existsReturns whether data to create aUserexists for a given player with a specifiedUUID.If this is false, thenload(UUID)will return an empty optional.- Parameters:
- playerUuid- The- UUIDof the player to check.
- Returns:
- If the player has existing user data that can be loaded.
 
- 
streamAllStream<GameProfile> streamAll()Gets aStreamthat returns aGameProfilefor each storedUsers.This Streammay contain profiles that only hold a result forIdentifiable.uniqueId(), that is, do not return a user's name. Such profiles should thus be treated as incomplete and are no more than an indicator that aUserassociated with the givenUUIDexists.Similarly, for GameProfiles that are filled and thus contain name data, the profile information is based on the latest information the server holds and no attempt is made to update this information.If you require up to date GameProfiles, use the appropriate methods on theGameProfileManagerand/or its associatedGameProfileManager.Use load(GameProfile)to load theUserdata associated with the associatedGameProfile.- Returns:
- A StreamofGameProfiles
 
- 
streamOfMatchesGets aStreamthat returns aGameProfilefor each storedUserwhose last known user names start with the given string (case-insensitive).It is important to note that the names this method uses to perform the matching is based on the latest information the server holds and no attempt is made to update this information. If you require up to date GameProfiles, use the appropriate methods on theGameProfileManagerand/or its associatedGameProfileManager.Use load(GameProfile)to load associatedUserdata.- Parameters:
- lastKnownName- The name to check for
- Returns:
- A StreamofGameProfiles
 
 
-