Package dev.aurelium.auraskills.api.user
Interface UserManager
public interface UserManager
-
Method Summary
Modifier and TypeMethodDescriptionGets an online player's user data from the player's UUID.Loads an offline user from storage, or gets a user from memory if the player is online.
-
Method Details
-
getUser
Gets an online player's user data from the player's UUID. Since only online players are loaded in memory, calling this method with an offline player's UUID will return an emptySkillsUser
object that returns default values for get methods and cannot be updated. If you don't know whether the uuid is an online player, useSkillsUser.isLoaded()
to check if the returned user is loaded.- Parameters:
playerId
- the UUID of the player- Returns:
- the SkillsUser object
-
loadUser
Loads an offline user from storage, or gets a user from memory if the player is online. When loading offline users, the returnedSkillsUser
may become out of date at any point if the user logs in, since joining will always load from storage. If the UUID doesn't represent a user that exists in either memory or storage, an emptySkillsUser
object will be returned whereSkillsUser.isLoaded()
will return false.- Parameters:
playerId
- the UUID of the player- Returns:
- a future with the SkillsUser, which is provided after the user is loaded asynchronously
-