Package net.gcnt.additionsplus.api
Class BaseCmd
java.lang.Object
net.gcnt.additionsplus.api.BaseCmd
Base command class that holds all information about a (sub) command and its usage.
-
Field Summary
Modifier and TypeFieldDescriptionString[]
boolean
org.bukkit.entity.Player
org.bukkit.command.CommandSender
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
processCommand
(org.bukkit.command.CommandSender sender, String[] args) Processes the command, used in listeners.abstract boolean
run()
The method that is called when this command is being executed.sendUsage
(boolean send) Send the usage of this command to the sender.
-
Field Details
-
plugin
-
sender
public org.bukkit.command.CommandSender sender -
args
-
command
-
mainCommand
-
forcePlayer
public boolean forcePlayer -
permission
-
subUsage
-
usage
-
player
public org.bukkit.entity.Player player
-
-
Constructor Details
-
BaseCmd
-
-
Method Details
-
processCommand
Processes the command, used in listeners. Checks for required permission.- Parameters:
sender
- The sender of the command.args
- The arguments the sender provided.- Returns:
- True when completed, false on failure.
-
run
public abstract boolean run()The method that is called when this command is being executed.- Returns:
- True when completed, false on failure.
-
sendUsage
Send the usage of this command to the sender.- Parameters:
send
- Whether to send the message or only return its value.- Returns:
- The formatted usage string.
-