Class PermissionNode
java.lang.Object
com.github.darksoulq.abyssallib.server.permission.PermissionNode
Represents a structured permission node with defaults and child relationships.
This class facilitates the fluent definition of permissions before they are
registered with the Bukkit PluginManager.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchild(PermissionNode childNode, boolean value) Adds a child node using another PermissionNode instance.Adds a child node by string name.defaultValue(org.bukkit.permissions.PermissionDefault defaultValue) Sets the default value for this permission.description(String description) Sets the description for this permission.org.bukkit.permissions.PermissionDefaultgetNode()booleanhas(org.bukkit.permissions.Permissible permissible) Checks if a permissible object (like a Player) has this specific node.org.bukkit.permissions.PermissiontoBukkit()Converts this node into a BukkitPermissionobject.toString()
-
Constructor Details
-
PermissionNode
Constructs a new PermissionNode.- Parameters:
node- The raw permission string.
-
-
Method Details
-
defaultValue
Sets the default value for this permission.- Parameters:
defaultValue- ThePermissionDefaultbehavior.- Returns:
- This node instance for chaining.
-
description
Sets the description for this permission.- Parameters:
description- A string describing the permission.- Returns:
- This node instance for chaining.
-
child
Adds a child node by string name.- Parameters:
childNode- The string of the child permission.value- The value the child receives when this node is true.- Returns:
- This node instance for chaining.
-
child
Adds a child node using another PermissionNode instance.- Parameters:
childNode- The PermissionNode to inherit.value- The value the child receives when this node is true.- Returns:
- This node instance for chaining.
-
getNode
- Returns:
- The raw permission node string.
-
getDefaultValue
public org.bukkit.permissions.PermissionDefault getDefaultValue()- Returns:
- The
PermissionDefaultvalue of this node.
-
getDescription
- Returns:
- The description of this permission.
-
getChildren
-
has
public boolean has(org.bukkit.permissions.Permissible permissible) Checks if a permissible object (like a Player) has this specific node.- Parameters:
permissible- The entity to check.- Returns:
- True if the entity has the permission.
-
toBukkit
public org.bukkit.permissions.Permission toBukkit()Converts this node into a BukkitPermissionobject.This method utilizes lazy initialization to cache the result.
- Returns:
- The Bukkit Permission representation.
-
toString
-