Interface User

All Known Implementing Classes:
UserProvider

public sealed interface User permits UserProvider
User interface to manage users.
  • Method Details

    • existsUser

      boolean existsUser(UUID uuid)
      Checks if a user exists.
      Parameters:
      uuid - The unique id of the user.
      Returns:
      True if the user exists, otherwise false.
    • existsUser

      boolean existsUser(String username)
      Checks if a user exists.
      Parameters:
      username - The username of the user.
      Returns:
      True if the user exists, otherwise false.
    • createNewUser

      void createNewUser(UUID uuid, String username)
      Create a new user and check if the user already exists. If the user already exists, the method will return without creating a new user.
      Parameters:
      uuid - The unique id of the user.
      username - The username of the user.
    • deleteUser

      void deleteUser(UUID uuid)
      Deletes a user.
      Parameters:
      uuid - The unique id of the user.
    • getId

      int getId(UUID uuid)
      Obtains the id of a user.
      Parameters:
      uuid - The unique id of the user.
      Returns:
      The id of the user.
    • getId

      int getId(String username)
      Obtains the id of a user.
      Parameters:
      username - The username of the user.
      Returns:
      The id of the user.
    • getUniqueId

      UUID getUniqueId(String username)
      Obtains the unique id of a user.
      Parameters:
      username - The username of the user.
      Returns:
      The unique id of the user.
    • getUniqueId

      UUID getUniqueId(int id)
      Obtains the unique id of a user.
      Parameters:
      id - The id of the user.
      Returns:
      The unique id of the user.
    • getUsername

      String getUsername(UUID uuid)
      Obtains the username of a user.
      Parameters:
      uuid - The unique id of the user.
      Returns:
      The username of the user.
    • getUsername

      String getUsername(int id)
      Obtains the username of a user. If the id -1 then the method will return "CONSOLE".
      Parameters:
      id - The id of the user.
      Returns:
      The username of the user.
    • rename

      void rename(UUID uuid, String newName)
      Renames a user.
      Parameters:
      uuid - The unique id of the user.
      newName - The new username of the user.
    • getUniqueIds

      List<UUID> getUniqueIds()
      Obtains a list of all unique ids.
      Returns:
      A list of all unique ids.
    • getUsernames

      List<String> getUsernames()
      Obtains a list of all usernames.
      Returns:
      A list of all usernames.
    • getIds

      List<Integer> getIds()
      Obtains a list of all ids.
      Returns:
      A list of all ids.
    • joinUser

      void joinUser(UUID uuid, String username)
      Join a user to the server. Create a new user if the user does not exist. Check if the user changes their name and rename them.
      Parameters:
      uuid - The unique id of the user.
      username - The username of the user.
    • loadExpired

      void loadExpired()
      Load all expired things.
    • getSettings

      UserSettings getSettings()
      Obtains the settings of a user.
      Returns:
      The settings of the user.
    • getParent

      UserParent getParent()
      Obtains the parent of a user.
      Returns:
      The parent of the user.
    • getPermission

      UserPermission getPermission()
      Obtains the permission of a user.
      Returns:
      The permission of the user.
    • getPlayTime

      PlayTime getPlayTime()
      Obtains the play time of a user.
      Returns:
      The play time of the user.