Class PermissionManager
java.lang.Object
fr.hytale.loader.permission.PermissionManager
Central manager for player permissions in HytaleLoader.
This singleton class stores and manages permissions for all players. Permissions are stored by player UUID to persist across Player instance creations.
- Since:
- 1.0.3
- Version:
- 1.0.4
- Author:
- HytaleLoader
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPermission(UUID playerUUID, Permission permission) Adds a permission to a player.voidclearAll()Clears all permissions for all players.voidclearPermissions(UUID playerUUID) Clears all permissions for a player.static PermissionManagerGets the singleton instance of the PermissionManager.getPermissions(UUID playerUUID) Gets all permissions for a player.intGets the number of players with stored permissions.booleanhasPermission(UUID playerUUID, Permission permission) Checks if a player has a specific permission.booleanremovePermission(UUID playerUUID, Permission permission) Removes a permission from a player.
-
Method Details
-
getInstance
Gets the singleton instance of the PermissionManager.- Returns:
- the PermissionManager instance
-
hasPermission
Checks if a player has a specific permission.- Parameters:
playerUUID- the player's UUIDpermission- the permission to check- Returns:
- true if the player has the permission
-
addPermission
Adds a permission to a player.- Parameters:
playerUUID- the player's UUIDpermission- the permission to add
-
removePermission
Removes a permission from a player.- Parameters:
playerUUID- the player's UUIDpermission- the permission to remove- Returns:
- true if the permission was removed
-
getPermissions
Gets all permissions for a player.- Parameters:
playerUUID- the player's UUID- Returns:
- an unmodifiable set of permissions
-
clearPermissions
Clears all permissions for a player.- Parameters:
playerUUID- the player's UUID
-
clearAll
public void clearAll()Clears all permissions for all players.Use with caution - this will remove all stored permissions.
-
getPlayerCount
public int getPlayerCount()Gets the number of players with stored permissions.- Returns:
- the number of players with permissions
-