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.Builderbuilder()Command builder.
This builder adds permission.default Command.BuilderCommand builder.
This builder adds arguments if they exist.default CommandResultexecute(CommandContext context) Check the command arguments and determine who is using the command.voidexecute(CommandContext context, Audience src, Locale locale, boolean isPlayer) Command code execution.default Command.ParameterizedCommand 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 booleangetBoolean(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 StringgetString(CommandContext context, String arg, String def) getUser(CommandContext context) default booleandefault voidCommand 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:
executein 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.
-