Improved Javadoc in BentoBoxCommand interface

This commit is contained in:
Florian CUNY 2018-08-09 17:07:53 +02:00
parent 1155549e4c
commit ceb88d9c7b

View File

@ -13,26 +13,34 @@ import world.bentobox.bentobox.api.user.User;
public interface BentoBoxCommand { public interface BentoBoxCommand {
/** /**
* Anything that needs to be set up for this command. * Setups anything that is needed for this command.
* Register subcommands in this section. * <br/><br/>
* It is recommended you do the following in this method:
* <ul>
* <li>Register any of the sub-commands of this command;</li>
* <li>Define the permission required to use this command using {@link CompositeCommand#setPermission(String)};</li>
* <li>Define whether this command can only be run by players or not using {@link CompositeCommand#setOnlyPlayer(boolean)};</li>
* </ul>
*/ */
void setup(); void setup();
/** /**
* What will be executed when this command is run * Defines what will be executed when this command is run.
* @param user the User who is executing the command * @param user The {@link User} who is executing this command.
* @param label the label which has been used to execute the command (can be the command's label OR an alias) * @param label The label which has been used to execute this command.
* @param args the command arguments * It can be {@link CompositeCommand#getLabel()} or an alias.
* @return true or false - true if the command executed successfully * @param args The command arguments.
* @return {@code true} if the command executed successfully, {@code false} otherwise.
*/ */
boolean execute(User user, String label, List<String> args); boolean execute(User user, String label, List<String> args);
/** /**
* Tab Completer for CompositeCommands. Note that any registered sub-commands will be automatically * Tab Completer for CompositeCommands.
* added to the list must not be manually added. Use this to add tab-complete for things like names. * Note that any registered sub-commands will be automatically added to the list.
* @param user - the User * Use this to add tab-complete for things like names.
* @param alias - alias for command * @param user The {@link User} who is executing this command.
* @param args - command arguments * @param alias Alias for command
* @param args Command arguments
* @return List of strings that could be used to complete this command. * @return List of strings that could be used to complete this command.
*/ */
default Optional<List<String>> tabComplete(User user, String alias, List<String> args) { default Optional<List<String>> tabComplete(User user, String alias, List<String> args) {