Package net.lapismc.lapiscore
Class LapisCorePermissions
- java.lang.Object
-
- net.lapismc.lapiscore.LapisCorePermissions
-
public class LapisCorePermissions extends java.lang.ObjectThis class handles the complex custom permission system that LapisCore
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLapisCorePermissions.PermissionManagerThis class is used to store and retrieve permissions
-
Constructor Summary
Constructors Constructor Description LapisCorePermissions(LapisCorePlugin core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlayerPermissioncalculatePermission(java.util.UUID uuid)Calculate the PlayerPermission for a playerorg.bukkit.permissions.PermissiongetAssignedPermission(java.util.UUID uuid)Get the Bukkit permission assigned to a playerprotected org.bukkit.permissions.PermissiongetOfflinePlayerPermission(java.util.UUID uuid)Override this method to provide a method of retrieving the players permission while they are offlinejava.lang.IntegergetPermissionValue(java.util.UUID uuid, LapisPermission permission)Get the raw Integer value of the permission for a playerbooleanisPermitted(java.util.UUID uuid, LapisPermission permission)Check if a player is given a permissionvoidloadPermissions()Call this method to load the permission values from config once all of your LapisPermissions have been registeredvoidregisterPermissions(LapisPermission... permission)Register permissions with LapisPermission objectsprotected voidsavePlayersPermission(java.util.UUID uuid, org.bukkit.permissions.Permission perm)Override this method to save the players permission for retrieval when they are offline
-
-
-
Constructor Detail
-
LapisCorePermissions
public LapisCorePermissions(LapisCorePlugin core)
- Parameters:
core- The LapisCore class that the permissions should be assigned too
-
-
Method Detail
-
registerPermissions
public void registerPermissions(LapisPermission... permission)
Register permissions with LapisPermission objects- Parameters:
permission- The permissions you wish to add
-
loadPermissions
public void loadPermissions()
Call this method to load the permission values from config once all of your LapisPermissions have been registered
-
getAssignedPermission
public org.bukkit.permissions.Permission getAssignedPermission(java.util.UUID uuid)
Get the Bukkit permission assigned to a player- Parameters:
uuid- The UUID of the player- Returns:
- Returns the Bukkit Permission that the plugin is using for permission calculations
-
getPermissionValue
public java.lang.Integer getPermissionValue(java.util.UUID uuid, LapisPermission permission)Get the raw Integer value of the permission for a player- Parameters:
uuid- The UUID of the playerpermission- The Permission you want a value for- Returns:
- Returns the Integer value for the permission assigned to the player, returns 0 if a permission could not be calculated
-
isPermitted
public boolean isPermitted(java.util.UUID uuid, LapisPermission permission)Check if a player is given a permission- Parameters:
uuid- The UUID of the playerpermission- The Permission you wish to check- Returns:
- Returns true if the value of Permission is greater than 0 otherwise false
-
calculatePermission
public PlayerPermission calculatePermission(java.util.UUID uuid)
Calculate the PlayerPermission for a player- Parameters:
uuid- The UUID of the player- Returns:
- Returns the PlayerPermission assigned to the player
-
getOfflinePlayerPermission
protected org.bukkit.permissions.Permission getOfflinePlayerPermission(java.util.UUID uuid)
Override this method to provide a method of retrieving the players permission while they are offline- Parameters:
uuid- The UUID of the player we want the permission of- Returns:
- Return the Bukkit Permission that is assigned to this player
-
savePlayersPermission
protected void savePlayersPermission(java.util.UUID uuid, org.bukkit.permissions.Permission perm)Override this method to save the players permission for retrieval when they are offline- Parameters:
uuid- The UUID of the player the permission is assigned toperm- The permission the player has been assigned
-
-