Package dev.cwhead.GravesX.integration
Class LuckPermsHandler
java.lang.Object
dev.cwhead.GravesX.integration.LuckPermsHandler
Provides an integration with LuckPerms to manage player permissions.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new LuckPerms integration instance by registering the LuckPerms service. -
Method Summary
Modifier and TypeMethodDescriptionbooleangrantPermission(org.bukkit.OfflinePlayer player, String permissionNode) Grants the specified permission to a player.booleanhasPermission(org.bukkit.entity.Player player, String permissionNode) Checks if a player has the specified permission.booleanhasPermission(org.bukkit.OfflinePlayer offlinePlayer, String permissionNode) Checks if a player has the specified permission.booleanChecks if a player is in the specified group.booleanrevokePermission(org.bukkit.OfflinePlayer player, String permissionNode) Revokes the specified permission from a player.
-
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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif the player is in the specified group, otherwisefalse.
-