mock command API

This commit is contained in:
dfsek
2021-03-07 23:44:19 -07:00
parent c44d26cc18
commit 0d58201e3f
14 changed files with 301 additions and 9 deletions
@@ -13,7 +13,7 @@ import java.util.Arrays;
import java.util.List;
/**
* Represents a command or subcommand, can be nested via getSubCommands.
* Represents a command or subcommands, can be nested via getSubCommands.
*/
public abstract class Command implements CommandExecutor, TabCompleter {
private final TerraPlugin main;
@@ -29,7 +29,8 @@ public abstract class Command implements CommandExecutor, TabCompleter {
}
/**
* Gets the name of the command/subcommand
* Gets the name of the command/subcommands
*
* @return Name of command
*/
public abstract String getName();
@@ -47,7 +48,7 @@ public abstract class Command implements CommandExecutor, TabCompleter {
* (if defined) will be sent to the player.
*
* @param sender Source of the command
* @param command Command which was executed
* @param command CommandTemplate which was executed
* @param label Alias of the command which was used
* @param args Passed command arguments
* @return true if a valid command, otherwise false
@@ -67,7 +68,7 @@ public abstract class Command implements CommandExecutor, TabCompleter {
* (if defined) will be sent to the player.
*
* @param sender Source of the command
* @param command Command which was executed
* @param command CommandTemplate which was executed
* @param label Alias of the command which was used
* @param args Passed command arguments
* @return true if a valid command, otherwise false
@@ -19,10 +19,10 @@ public abstract class PlayerCommand extends Command {
* If false is returned, then the "usage" plugin.yml entry for this command
* (if defined) will be sent to the player.
*
* @param sender Source of the command
* @param command Command which was executed
* @param label Alias of the command which was used
* @param args Passed command arguments
* @param sender Source of the command
* @param command CommandTemplate which was executed
* @param label Alias of the command which was used
* @param args Passed command arguments
* @return true if a valid command, otherwise false
*/
@Override
@@ -34,6 +34,7 @@ public abstract class PlayerCommand extends Command {
Player p = (Player) sender;
return execute(p, command, label, args);
}
/**
* Executes the given command, returning its success.
* <br>
@@ -41,7 +42,7 @@ public abstract class PlayerCommand extends Command {
* (if defined) will be sent to the player.
*
* @param sender Player that executed command
* @param command Command which was executed
* @param command CommandTemplate which was executed
* @param label Alias of the command which was used
* @param args Passed command arguments
* @return true if a valid command, otherwise false