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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
handleCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String s, String[] args)
Handle a command.void
registerCommand(SubCommand subCommand, String... args)
Register a command.void
registerCommand(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.
-