Package com.ryandw11.structure.commands
Class CommandHandler
java.lang.Object
com.ryandw11.structure.commands.CommandHandler
Extremely primitive command handler.
This will be replaced in the future with a proper one.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhandleCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String s, String[] args)Handle a command.voidregisterCommand(SubCommand subCommand, String... args)Register a command.voidregisterCommand(String s, SubCommand subCommand)Register a command.
-
Constructor Details
-
CommandHandler
public CommandHandler()
-
-
Method Details
-
registerCommand
Register a command.- Parameters:
s- The command to register.subCommand- The sub command.
-
registerCommand
Register a command.- Parameters:
subCommand- The sub command.args- The aliases to register.
-
handleCommand
public boolean handleCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String s, String[] args)Handle a command.Throws IllegalArgumentException if sub command does not exist.
- Parameters:
sender- The command sender.cmd- The command.s- The string.args- The arguments.- Returns:
- If the command is valid.
-