Package dev.oumaimaa.kawaiiapi.command
Class CommandManager.CommandBuilder
java.lang.Object
dev.oumaimaa.kawaiiapi.command.CommandManager.CommandBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionCommandBuilder(@NotNull org.bukkit.plugin.java.JavaPlugin plugin) Creates a new CommandBuilder. -
Method Summary
Modifier and TypeMethodDescriptionaddSubcommand(@NotNull Class<? extends SubCommand> subcommand) Adds a subcommand class.addSubcommands(@NotNull Class<? extends SubCommand>... subcommands) Adds multiple subcommand classes.Sets the command aliases.commandList(@Nullable CommandList commandList) Sets the command list display handler.description(@NotNull String description) Sets the command description.Sets the command name.voidregister()Builds and registers the command.Sets the command usage.
-
Constructor Details
-
CommandBuilder
public CommandBuilder(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin) Creates a new CommandBuilder.- Parameters:
plugin- The plugin instance
-
-
Method Details
-
name
Sets the command name.- Parameters:
name- The command name- Returns:
- This builder instance
-
description
Sets the command description.- Parameters:
description- The description- Returns:
- This builder instance
-
usage
Sets the command usage.- Parameters:
usage- The usage string- Returns:
- This builder instance
-
commandList
Sets the command list display handler.- Parameters:
commandList- The command list handler- Returns:
- This builder instance
-
aliases
Sets the command aliases.- Parameters:
aliases- The aliases- Returns:
- This builder instance
-
addSubcommand
public CommandManager.CommandBuilder addSubcommand(@NotNull @NotNull Class<? extends SubCommand> subcommand) Adds a subcommand class.- Parameters:
subcommand- The subcommand class- Returns:
- This builder instance
-
addSubcommands
@SafeVarargs public final CommandManager.CommandBuilder addSubcommands(@NotNull @NotNull Class<? extends SubCommand>... subcommands) Adds multiple subcommand classes.- Parameters:
subcommands- The subcommand classes- Returns:
- This builder instance
-
register
public void register()Builds and registers the command.- Throws:
IllegalStateException- if the command name is not set
-