Class LuckPermsHandler

java.lang.Object
com.ranull.graves.integration.LuckPermsHandler

public class LuckPermsHandler extends Object
Provides an integration with LuckPerms to manage player permissions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final net.luckperms.api.LuckPerms
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new LuckPerms integration instance by registering the LuckPerms service.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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
    isInGroup(org.bukkit.OfflinePlayer player, String groupName)
    Checks if a player is in the specified group.
    boolean
    revokePermission(org.bukkit.OfflinePlayer player, String permissionNode)
    Revokes the specified permission from a player.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public boolean hasPermission(org.bukkit.OfflinePlayer offlinePlayer, String permissionNode)
      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, otherwise false.
    • hasPermission

      public boolean hasPermission(org.bukkit.entity.Player player, String permissionNode)
      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, otherwise false.
    • grantPermission

      public boolean grantPermission(org.bukkit.OfflinePlayer player, String permissionNode)
      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, otherwise false.
    • revokePermission

      public boolean revokePermission(org.bukkit.OfflinePlayer player, String permissionNode)
      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, otherwise false.
    • isInGroup

      public boolean isInGroup(org.bukkit.OfflinePlayer player, String groupName)
      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, otherwise false.