Interface UserManager


public interface UserManager
  • Method Summary

    Modifier and Type
    Method
    Description
    getUser(UUID playerId)
    Gets an online player's user data from the player's UUID.
    loadUser(UUID playerId)
    Loads an offline user from storage, or gets a user from memory if the player is online.
  • Method Details

    • getUser

      SkillsUser getUser(UUID playerId)
      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 empty SkillsUser object that returns default values for get methods and cannot be updated. If you don't know whether the uuid is an online player, use SkillsUser.isLoaded() to check if the returned user is loaded.
      Parameters:
      playerId - the UUID of the player
      Returns:
      the SkillsUser object
    • loadUser

      CompletableFuture<SkillsUser> loadUser(UUID playerId)
      Loads an offline user from storage, or gets a user from memory if the player is online. When loading offline users, the returned SkillsUser 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 empty SkillsUser object will be returned where SkillsUser.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