Package net.lewmc.foundry.command
Class FoundryCommand
java.lang.Object
net.lewmc.foundry.command.FoundryCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
- Direct Known Subclasses:
FoundryConsoleCommand
,FoundryPlayerCommand
Foundry's command class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
hasPermission
(org.bukkit.command.CommandSender sender, String permission) Checks if the CommandSender has the required permission.boolean
onCommand
(org.bukkit.command.CommandSender cs, org.bukkit.command.Command command, String label, String[] args) Runs the command.protected abstract boolean
onRun
(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args) Runs the command.protected abstract String
Stores the permission that is required.
-
Constructor Details
-
FoundryCommand
public FoundryCommand()
-
-
Method Details
-
requiredPermission
Stores the permission that is required.- Returns:
- String - The permission string.
-
onRun
protected abstract boolean onRun(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args) Runs the command.- Parameters:
sender
- CommandSender - The sender of the command.command
- Command - The command.label
- String - Label for the command.args
- String[] - Arguments passed to the command.- Returns:
- boolean - If the command was successful.
-
hasPermission
Checks if the CommandSender has the required permission.- Parameters:
sender
- CommandSender - The sender of the command.permission
- String - The permission string.- Returns:
- boolean - If the CommandSender has the required permission.
-
onCommand
public boolean onCommand(org.bukkit.command.CommandSender cs, org.bukkit.command.Command command, String label, String[] args) Runs the command.- Specified by:
onCommand
in interfaceorg.bukkit.command.CommandExecutor
- Parameters:
cs
- CommandSender - The sender of the command.command
- Command - The command.label
- String - Label for the command.args
- String[] - Arguments passed to the command.- Returns:
- boolean - If the command was successful.
-