public final class BladeConfiguration<Text>
extends java.lang.Object
| Constructor and Description |
|---|
BladeConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
java.util.function.Consumer<java.lang.Runnable> |
asyncExecutor()
The executor used for running asynchronous commands (commands annotated with
Async). |
BladeConfiguration<Text> |
asyncExecutor(java.util.function.Consumer<java.lang.Runnable> asyncExecutor)
The executor used for running asynchronous commands (commands annotated with
Async). |
java.lang.String |
commandQualifier()
The qualifier used to register commands.
|
BladeConfiguration<Text> |
commandQualifier(java.lang.String commandQualifier)
The qualifier used to register commands.
|
java.lang.String |
defaultPermissionMessage()
The default permission message sent to users when they don't have permission to execute a command.
|
BladeConfiguration<Text> |
defaultPermissionMessage(java.lang.String defaultPermissionMessage)
The default permission message sent to users when they don't have permission to execute a command.
|
long |
executionTimeWarningThreshold()
The execution time threshold (in milliseconds) after which a warning is logged when a command takes too long to execute on the main thread.
|
BladeConfiguration<Text> |
executionTimeWarningThreshold(long executionTimeWarningThreshold)
The execution time threshold (in milliseconds) after which a warning is logged when a command takes too long to execute on the main thread.
|
CommandFeedbackCreator<Text> |
feedbackCreator()
The creator used for generating command feedback messages (usage and help).
|
BladeConfiguration<Text> |
feedbackCreator(CommandFeedbackCreator<Text> feedbackCreator)
The creator used for generating command feedback messages (usage and help).
|
HelpGenerator<Text> |
helpGenerator()
The help generator used for generating help messages for commands.
|
BladeConfiguration<Text> |
helpGenerator(HelpGenerator<Text> helpGenerator)
The help generator used for generating help messages for commands.
|
java.util.Comparator<BladeCommand> |
helpSorter()
The comparator used to sort commands in help messages.
|
BladeConfiguration<Text> |
helpSorter(java.util.Comparator<BladeCommand> helpSorter)
The comparator used to sort commands in help messages.
|
boolean |
lenientFlagMatching()
Whether Blade should strictly match flags when parsing command arguments.
|
BladeConfiguration<Text> |
lenientFlagMatching(boolean lenientFlagMatching)
Whether Blade should strictly match flags when parsing command arguments.
|
BladeLogger |
logger()
The logger Blade uses to log messages, warnings and errors.
|
BladeConfiguration<Text> |
logger(BladeLogger logger)
The logger Blade uses to log messages, warnings and errors.
|
boolean |
overrideCommands()
Whether Blade should override vanilla commands when registering commands with the same name.
|
BladeConfiguration<Text> |
overrideCommands(boolean overrideCommands)
Whether Blade should override vanilla commands when registering commands with the same name.
|
boolean |
strictArgumentCount()
Whether Blade should strictly enforce the argument count when executing commands.
|
BladeConfiguration<Text> |
strictArgumentCount(boolean strictArgumentCount)
Whether Blade should strictly enforce the argument count when executing commands.
|
boolean |
strictFlagCount()
Whether Blade should strictly enforce that each flag is only provided once.
|
BladeConfiguration<Text> |
strictFlagCount(boolean strictFlagCount)
Whether Blade should strictly enforce that each flag is only provided once.
|
TabCompleter |
tabCompleter()
The tab completer used for providing command completions.
|
BladeConfiguration<Text> |
tabCompleter(TabCompleter tabCompleter)
The tab completer used for providing command completions.
|
void |
validate() |
boolean |
verbose()
Whether Blade should log verbose output.
|
BladeConfiguration<Text> |
verbose(boolean verbose)
Whether Blade should log verbose output.
|
public void validate()
public BladeConfiguration<Text> verbose(boolean verbose)
This includes detailed information like command registration.
this.public BladeConfiguration<Text> overrideCommands(boolean overrideCommands)
For example, if you register a command named whitelist, the vanilla /whitelist command
will be overridden if this option is enabled.
this.public BladeConfiguration<Text> commandQualifier(java.lang.String commandQualifier)
Most platforms (Bukkit, Velocity, etc.) prefix commands with the plugin name. As an example, you can access
the plugins command in Bukkit using /bukkit:plugins as well as /plugins.
By default, this is set to your plugin's name.
this.public BladeConfiguration<Text> defaultPermissionMessage(java.lang.String defaultPermissionMessage)
This can be overridden on a per-command basis using the Permission annotation.
this.public BladeConfiguration<Text> executionTimeWarningThreshold(long executionTimeWarningThreshold)
this.public BladeConfiguration<Text> strictArgumentCount(boolean strictArgumentCount)
When enabled (default), if a user provides more arguments than a command expects, Blade will reject the command execution and inform the user about the incorrect argument count.
this.public BladeConfiguration<Text> lenientFlagMatching(boolean lenientFlagMatching)
When disabled (default), any unknown flags that are encountered will be parsed as standard arguments.
This also applies to BSD-style flags, e.g. -ab will be parsed as an argument if either -a or -b are unknown.
When enabled, unknown flags will simply be ignored during parsing.
this.public BladeConfiguration<Text> strictFlagCount(boolean strictFlagCount)
When enabled (default), if a user provides the same flag multiple times, Blade will reject the command execution and inform the user about the duplicate flags.
this.public BladeConfiguration<Text> asyncExecutor(java.util.function.Consumer<java.lang.Runnable> asyncExecutor)
Async).this.public BladeConfiguration<Text> tabCompleter(TabCompleter tabCompleter)
By default, a platform-specific implementation is used.
this.public BladeConfiguration<Text> helpGenerator(HelpGenerator<Text> helpGenerator)
this.public BladeConfiguration<Text> feedbackCreator(CommandFeedbackCreator<Text> feedbackCreator)
this.public BladeConfiguration<Text> logger(BladeLogger logger)
this.public BladeConfiguration<Text> helpSorter(java.util.Comparator<BladeCommand> helpSorter)
By default, commands are sorted alphabetically by their main label.
this.public boolean verbose()
This includes detailed information like command registration.
public boolean overrideCommands()
For example, if you register a command named whitelist, the vanilla /whitelist command
will be overridden if this option is enabled.
public java.lang.String commandQualifier()
Most platforms (Bukkit, Velocity, etc.) prefix commands with the plugin name. As an example, you can access
the plugins command in Bukkit using /bukkit:plugins as well as /plugins.
By default, this is set to your plugin's name.
public java.lang.String defaultPermissionMessage()
This can be overridden on a per-command basis using the Permission annotation.
public long executionTimeWarningThreshold()
public boolean strictArgumentCount()
When enabled (default), if a user provides more arguments than a command expects, Blade will reject the command execution and inform the user about the incorrect argument count.
public boolean lenientFlagMatching()
When disabled (default), any unknown flags that are encountered will be parsed as standard arguments.
This also applies to BSD-style flags, e.g. -ab will be parsed as an argument if either -a or -b are unknown.
When enabled, unknown flags will simply be ignored during parsing.
public boolean strictFlagCount()
When enabled (default), if a user provides the same flag multiple times, Blade will reject the command execution and inform the user about the duplicate flags.
public java.util.function.Consumer<java.lang.Runnable> asyncExecutor()
Async).public TabCompleter tabCompleter()
By default, a platform-specific implementation is used.
public HelpGenerator<Text> helpGenerator()
public CommandFeedbackCreator<Text> feedbackCreator()
public BladeLogger logger()
public java.util.Comparator<BladeCommand> helpSorter()
By default, commands are sorted alphabetically by their main label.