Interface ParameterizedCommand
- All Superinterfaces:
CommandExecutor
,PluginCommand
- All Known Subinterfaces:
ParameterizedPlayerCommand
This interface is designed to simplify the creation of commands and add additional functionality to them.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Command building.default Command.Builder
builder()
Command builder.
This builder adds permission.default Command.Builder
Command builder.
This builder adds arguments if they exist.default CommandResult
execute
(CommandContext context) Check the command arguments and determine who is using the command.void
execute
(CommandContext context, Audience src, Locale locale, boolean isPlayer) Command code execution.default Command.Parameterized
Command building.
Automatically applies permission and arguments if available.default <T> Optional<T>
getArgument
(CommandContext context, Class<T> object, String arg) Getting an object from a command argument.default <T> Optional<T>
getArgument
(CommandContext context, Parameter.Value<T> value) Getting an object from a command argument.getBoolean
(CommandContext context, String arg) default boolean
getBoolean
(CommandContext context, String arg, boolean def) default Optional<ServerLocation>
getLocation
(CommandContext context) default Optional<ServerPlayer>
getPlayer
(CommandContext context) Map of arguments.
The argument can be optional for the player and mandatory for the console.getString
(CommandContext context, String arg) default String
getString
(CommandContext context, String arg, String def) getUser
(CommandContext context) default boolean
default void
Command registration.Methods inherited from interface sawfowl.commandpack.api.commands.PluginCommand
checkCooldown, command, delay, economy, exception, exception, exception, exception, exception, exception, exception, exception, getCommandSettings, getComponent, getComponent, getComponent, getContainer, getCooldowns, getListTexts, getLocale, getPluginLocale, getText, getText, isEnable, permission, sendPaginationList, success, text, text, timeFormat, trackingName
-
Method Details
-
execute
void execute(CommandContext context, Audience src, Locale locale, boolean isPlayer) throws CommandException Command code execution.- Throws:
CommandException
-
getSettingsMap
Map<String,ParameterSettings> getSettingsMap()Map of arguments.
The argument can be optional for the player and mandatory for the console. -
build
Command.Parameterized build()Command building. -
execute
Check the command arguments and determine who is using the command.- Specified by:
execute
in interfaceCommandExecutor
- Throws:
CommandException
-
onlyPlayer
default boolean onlyPlayer() -
register
Command registration. -
builder
Command builder.
This builder adds permission. -
builderNoPerm
Command builder.
This builder adds arguments if they exist. -
fastBuild
Command building.
Automatically applies permission and arguments if available. -
getPlayer
-
getUser
-
getBoolean
-
getBoolean
-
getString
-
getString
-
getLocation
-
getArgument
Getting an object from a command argument. -
getArgument
Getting an object from a command argument.
-