Package com.ranull.graves.integration
Class LuckPermsHandler
java.lang.Object
com.ranull.graves.integration.LuckPermsHandler
Provides an integration with LuckPerms to manage player permissions.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new LuckPerms integration instance by registering the LuckPerms service. -
Method Summary
Modifier and TypeMethodDescriptionboolean
grantPermission
(org.bukkit.OfflinePlayer player, String permissionNode) Grants the specified permission to a player.boolean
hasPermission
(org.bukkit.entity.Player player, String permissionNode) Checks if a player has the specified permission.boolean
hasPermission
(org.bukkit.OfflinePlayer offlinePlayer, String permissionNode) Checks if a player has the specified permission.boolean
Checks if a player is in the specified group.boolean
revokePermission
(org.bukkit.OfflinePlayer player, String permissionNode) Revokes the specified permission from a player.
-
Field Details
-
luckPerms
private final net.luckperms.api.LuckPerms luckPerms
-
-
Constructor Details
-
LuckPermsHandler
public LuckPermsHandler()Constructs a new LuckPerms integration instance by registering the LuckPerms service. If LuckPerms is not available, an IllegalStateException is thrown.
-
-
Method Details
-
hasPermission
Checks if a player has the specified permission.- Parameters:
offlinePlayer
- The offline player whose permission to check.permissionNode
- The permission node to check.- Returns:
true
if the player has the specified permission, otherwisefalse
.
-
hasPermission
Checks if a player has the specified permission.- Parameters:
player
- The player whose permission to check.permissionNode
- The permission node to check.- Returns:
true
if the player has the specified permission, otherwisefalse
.
-
grantPermission
Grants the specified permission to a player.- Parameters:
player
- The player to whom the permission will be granted.permissionNode
- The permission node to grant.- Returns:
true
if the permission was successfully granted, otherwisefalse
.
-
revokePermission
Revokes the specified permission from a player.- Parameters:
player
- The player from whom the permission will be revoked.permissionNode
- The permission node to revoke.- Returns:
true
if the permission was successfully revoked, otherwisefalse
.
-
isInGroup
Checks if a player is in the specified group.- Parameters:
player
- The player whose group membership to check.groupName
- The name of the group to check.- Returns:
true
if the player is in the specified group, otherwisefalse
.
-