public static class CommandData.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
CommandData.Builder |
addAlias(@NonNull String alias)
Adds the alias to the set of aliases for this Command.
|
CommandData.Builder |
addAliases(String... aliases)
Adds all the aliases in the passed String collection, without clearing the current aliases.
|
CommandData.Builder |
addParameters(CommandParameter[]... paramSet)
Adds the set of parameters as a Command overload, without clearing the current overloads.
|
CommandData.Builder |
addPermission(@NonNull String permission)
Adds the passed permission String to the list of allowed permissions.
|
CommandData.Builder |
addPermissions(String... permissions)
Adds all of the permissions in the passed String collection to the list of allowed permissions,
without clearing the current permissions set.
|
CommandData |
build() |
CommandData.Builder |
setAliases(String... aliases)
Clears the current aliases and sets the passed collection of Strings as the new aliases.
|
CommandData.Builder |
setDescription(@NonNull String description)
Sets the description string for this Command.
|
CommandData.Builder |
setParameters(CommandParameter[]... paramSet)
Clears the command overloads and sets the passed collection as the overloads for this Command.
|
CommandData.Builder |
setParameters(@NonNull List<CommandParameter[]> parameters)
Clears the command overloads and sets the passed collection as the overloads for this Command.
|
CommandData.Builder |
setPermissionMessage(@NonNull String message)
Sets the message to send to the user when they lack the required permissions to run this
Command.
|
CommandData.Builder |
setPermissions(String... permissions)
Clears all current permissions and sets as the passed in collection.
|
CommandData.Builder |
setUsageMessage(@NonNull String usage)
Sets the usage message.
|
public Builder(@NonNull
@NonNull String name)
public CommandData build()
public CommandData.Builder setDescription(@NonNull @NonNull String description)
LocaleManager with your translation texts if you wish to use this feature.description - Description string, which may contain a language file constant (ex: %commands.ban.description)public CommandData.Builder setUsageMessage(@NonNull @NonNull String usage)
false, and sends
the message string to the user.usage - Usage string for this command (ex: "/say <message>")public CommandData.Builder setPermissionMessage(@NonNull @NonNull String message)
message - Custom message to send to user if they do not have the required permissionpublic CommandData.Builder setPermissions(@NonNull String... permissions)
Note: A player only needs to have one of the permissions in the list to be able to execute the command.
permissions - Collection of String premissionspublic CommandData.Builder addPermission(@NonNull @NonNull String permission)
Note: A player only needs to have one of the permissions in the list to be able to execute the command.
permission - Permission string to addpublic CommandData.Builder addPermissions(@NonNull String... permissions)
Note: A player only needs to have one of the permissions in the list to be able to execute the command.
permissions - Collection of permissions to addpublic CommandData.Builder setAliases(@NonNull String... aliases)
aliases - Collection of String aliases for this Commandpublic CommandData.Builder addAlias(@NonNull @NonNull String alias)
alias - Alias to addpublic CommandData.Builder addAliases(@NonNull String... aliases)
aliases - Collection of String aliases to add to this Command.public CommandData.Builder setParameters(@NonNull CommandParameter[]... paramSet)
paramSet - Collection of CommandParameter arrays to set as the new overloadspublic CommandData.Builder setParameters(@NonNull @NonNull List<CommandParameter[]> parameters)
parameters - List of CommandParameter[]public CommandData.Builder addParameters(@NonNull CommandParameter[]... paramSet)
paramSet - The set of CommandParameter arrays to add to the overloads.Copyright © 2020. All rights reserved.