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 booleanhasPermission(org.bukkit.command.CommandSender sender, String permission) Checks if the CommandSender has the required permission.booleanonCommand(org.bukkit.command.CommandSender cs, org.bukkit.command.Command command, String label, String[] args) Runs the command.protected abstract booleanonRun(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args) Runs the command.protected abstract StringStores 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:
onCommandin 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.
-