Package io.github.simplexdevelopment.cl
Class Permissible
java.lang.Object
io.github.simplexdevelopment.cl.Permissible
- Direct Known Subclasses:
CommandBase
-
Constructor Summary
ConstructorsConstructorDescriptionPermissible(String permission, String permissionMessage, boolean allowConsole) -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the permission for the command it represents.Gets the message to display when a user doesn't have permission to run the command.booleanhasPermission(org.bukkit.command.CommandSender sender) Checks if the source of the command has the permission required to run it.
-
Constructor Details
-
Permissible
- Parameters:
permission- The permission the user should have to run the commandpermissionMessage- The message to send when the user does not have the permission to run the command.allowConsole- Whether to allow the command to be run anywhere, or only in game.
-
-
Method Details
-
getPermission
Gets the permission for the command it represents.- Returns:
- The permission required to run the command.
-
getPermissionMessage
Gets the message to display when a user doesn't have permission to run the command.- Returns:
- The message to send the user when they do not have the required permission.
-
hasPermission
public boolean hasPermission(org.bukkit.command.CommandSender sender) Checks if the source of the command has the permission required to run it.- Parameters:
sender- The command source- Returns:
- Whether the sender has the permission or not.
-
allowConsole
public boolean allowConsole()- Returns:
- Whether to allow the command to be run from anywhere, or only players.
-