Package de.murmelmeister.murmelapi.user
Interface User
- All Known Implementing Classes:
UserProvider
User interface to manage users.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateNewUser(UUID uuid, String username) Create a new user and check if the user already exists.voiddeleteUser(UUID uuid) Deletes a user.booleanexistsUser(String username) Checks if a user exists.booleanexistsUser(UUID uuid) Checks if a user exists.intObtains the id of a user.intObtains the id of a user.getIds()Obtains a list of all ids.Obtains the parent of a user.Obtains the permission of a user.Obtains the play time of a user.Obtains the settings of a user.getUniqueId(int id) Obtains the unique id of a user.getUniqueId(String username) Obtains the unique id of a user.Obtains a list of all unique ids.getUsername(int id) Obtains the username of a user.getUsername(UUID uuid) Obtains the username of a user.Obtains a list of all usernames.voidJoin a user to the server.voidLoad all expired things.voidRenames a user.
-
Method Details
-
existsUser
Checks if a user exists.- Parameters:
uuid- The unique id of the user.- Returns:
- True if the user exists, otherwise false.
-
existsUser
Checks if a user exists.- Parameters:
username- The username of the user.- Returns:
- True if the user exists, otherwise false.
-
createNewUser
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
Deletes a user.- Parameters:
uuid- The unique id of the user.
-
getId
Obtains the id of a user.- Parameters:
uuid- The unique id of the user.- Returns:
- The id of the user.
-
getId
Obtains the id of a user.- Parameters:
username- The username of the user.- Returns:
- The id of the user.
-
getUniqueId
Obtains the unique id of a user.- Parameters:
username- The username of the user.- Returns:
- The unique id of the user.
-
getUniqueId
Obtains the unique id of a user.- Parameters:
id- The id of the user.- Returns:
- The unique id of the user.
-
getUsername
Obtains the username of a user.- Parameters:
uuid- The unique id of the user.- Returns:
- The username of the user.
-
getUsername
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
Renames a user.- Parameters:
uuid- The unique id of the user.newName- The new username of the user.
-
getUniqueIds
Obtains a list of all unique ids.- Returns:
- A list of all unique ids.
-
getUsernames
Obtains a list of all usernames.- Returns:
- A list of all usernames.
-
getIds
Obtains a list of all ids.- Returns:
- A list of all ids.
-
joinUser
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.
-