Class AbstractCommandExecutor

java.lang.Object
com.ultikits.ultitools.abstracts.AbstractCommandExecutor
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor
Direct Known Subclasses:
AbstractCommendExecutor, CloudLoginCommand, PluginInstallCommands, UltiToolsCommands

@Deprecated(since="6.2.0", forRemoval=true) public abstract class AbstractCommandExecutor extends Object implements org.bukkit.command.TabExecutor
Deprecated, for removal: This API element is subject to removal in a future version.
This class is maintained for backward compatibility. Use BaseCommandExecutor instead, which provides better architecture with Chain of Responsibility pattern.

此类仅为向后兼容而保留。 请使用 BaseCommandExecutor, 它提供了使用责任链模式的更好架构。

This abstract class represents a command executor. It implements the TabExecutor interface from the Bukkit API.

这个抽象类代表了一个命令执行器。 它实现了Bukkit API中的TabExecutor接口。

Since:
6.2.0 deprecated
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
    Deprecated, for removal: This API element is subject to removal in a future version.
    Result object for cooldown tick processing.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<UUID,Method>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private final com.google.common.collect.BiMap<String,Method>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private final Map<List<Class<?>>,Function<String,?>>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private final Map<UUID,Method>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private final Map<UUID,Method>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor that initializes parsers and scans command mappings.
  • Method Summary

    Modifier and Type
    Method
    Description
    private Object[]
    buildParams(String[] strings, Method method, org.bukkit.command.CommandSender commandSender)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Builds the parameters of the command.
    private boolean
    checkCD(org.bukkit.command.CommandSender sender)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender need to wait for the command cool down.
    private boolean
    checkCmdTargetType(org.bukkit.command.CommandSender sender, CmdTarget cmdTarget)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender is valid.
    private boolean
    checkLock(org.bukkit.command.CommandSender sender, Method method)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender need to wait for the previous command to finish.
    private boolean
    checkOp(org.bukkit.command.CommandSender sender)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender need to be an OP.
    private boolean
    checkOp(org.bukkit.command.CommandSender sender, Method method)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender need to be an OP.
    private boolean
    checkParameters(String[] args, Method method, org.bukkit.command.CommandSender commandSender, org.bukkit.command.Command command)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private boolean
    checkPermission(org.bukkit.command.CommandSender sender)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender has permission.
    private boolean
    checkPermission(org.bukkit.command.CommandSender sender, Method method)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender has permission.
    private boolean
    checkSender(org.bukkit.command.CommandSender sender)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender is valid.
    private boolean
    checkSender(org.bukkit.command.CommandSender sender, Method method)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the sender is valid.
    protected void
    executeMethodWithLock(org.bukkit.command.CommandSender commandSender, Method method, Object[] params)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a method with usage limit lock handling.
    private String
    getArgAt(String format, int index)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the argument at the specified index.
    private void
    getArgSuggestion(org.bukkit.entity.Player player, org.bukkit.command.Command command, String[] strings, Method method, String arg, List<String> completions)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds suggestion to the list of suggestions.
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the format of the command.
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the instance of the command executor.
    private Method[]
    getMethod(Class<?> clazz, String suggestName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the suggest method array by the suggest method name from another class.
    private Method[]
    getMethod(String suggestName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the suggest method array by the suggest method name.
    private List<Method>
    getMethodsByArg(org.bukkit.entity.Player player, String command)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the methods that match the command.
    private Map<String,String[]>
    getParams(String[] args, String format)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a map of parameter match from a command.
    private <T> Function<String,T>
    getParser(Class<T> type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the parser of the parameter.
    private Method[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the suggest method array by the suggest method name.
    private String
    getSuggestName(Method method, String paramName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the suggest method name of the parameter.
    protected abstract void
    handleHelp(org.bukkit.command.CommandSender sender)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Abstract method that handles the help command.
    private void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Initializes the parsers.
    private Collection<?>
    invokeSuggestMethod(Object object, Method method, org.bukkit.entity.Player player, org.bukkit.command.Command command, String[] strings)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Invokes the suggest method.
    private boolean
    matchesArgument(String formatArg, String actualArg)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Compare the actual argument with the format argument.
    private boolean
    matchesLastArgument(String formatArg, String actualArg)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Compare the actual argument with the format argument.
    private Method
    Deprecated, for removal: This API element is subject to removal in a future version.
    Matches the command.
    boolean
    onCommand(org.bukkit.command.CommandSender commandSender, org.bukkit.command.Command command, String s, String[] strings)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Executes the command, returning its success.
    onTabComplete(org.bukkit.command.CommandSender commandSender, org.bukkit.command.Command command, String s, String[] strings)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Requests a list of possible completions for a command argument.
    private <T> Object
    parseType(String[] value, Class<T> type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Parses the type of the parameter.
    processCoolDownTick(UUID playerUUID, Method method, int time)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Process a single tick of the command cooldown.
    private void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Scans the command mappings.
    protected void
    sendErrorMessage(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sends the error message.
    private void
    setCoolDown(org.bukkit.command.CommandSender commandSender, Method method)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the cool down of the command.
    protected List<String>
    suggest(org.bukkit.entity.Player player, org.bukkit.command.Command command, String[] strings)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tab complete method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mappings

      private final com.google.common.collect.BiMap<String,Method> mappings
      Deprecated, for removal: This API element is subject to removal in a future version.
    • senderLock

      private final Map<UUID,Method> senderLock
      Deprecated, for removal: This API element is subject to removal in a future version.
    • serverLock

      private final Map<UUID,Method> serverLock
      Deprecated, for removal: This API element is subject to removal in a future version.
    • cmdCoolDown

      private final Map<UUID,Method> cmdCoolDown
      Deprecated, for removal: This API element is subject to removal in a future version.
    • parsers

      private final Map<List<Class<?>>,Function<String,?>> parsers
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • AbstractCommandExecutor

      public AbstractCommandExecutor()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor that initializes parsers and scans command mappings.

      构造函数,初始化解析器并扫描命令映射。

  • Method Details

    • checkCmdTargetType

      private boolean checkCmdTargetType(org.bukkit.command.CommandSender sender, CmdTarget cmdTarget)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender is valid.

      检查发送者是否有效。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      cmdTarget - The method that matches the command.
      匹配命令的方法。
      Returns:
      Whether the sender is valid.
      发送者是否有效。
    • getParams

      private Map<String,String[]> getParams(String[] args, String format)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets a map of parameter match from a command.

      从命令中获取参数匹配的映射。

      Parameters:
      args - The arguments of the command.
      命令的参数。
      format - The format of the command.
      命令的格式。
      Returns:
      The map of the parameters.
      参数的映射。
    • getInstance

      public AbstractCommandExecutor getInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the instance of the command executor.

      获取命令执行器的实例。

      Returns:
      The instance of the command executor.
      命令执行器的实例。
    • initParsers

      private void initParsers()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Initializes the parsers.

      初始化解析器。

    • getParser

      private <T> Function<String,T> getParser(Class<T> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the parser of the parameter.

      获取参数的解析器。

      Type Parameters:
      T - The type of the parameter.
      参数的类型。
      Parameters:
      type - The type of the parameter.
      参数的类型。
      Returns:
      The parser of the parameter.
      参数的解析器。
    • scanCommandMappings

      private void scanCommandMappings()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Scans the command mappings.

      扫描命令映射。

    • matchMethod

      private Method matchMethod(String[] args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Matches the command.

      匹配命令。

      Parameters:
      args - The arguments of the command.
      命令的参数。
      Returns:
      The method that matches the command.
      匹配命令的方法。
    • matchesArgument

      private boolean matchesArgument(String formatArg, String actualArg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Compare the actual argument with the format argument.

      将实际参数与格式参数进行比较。

      Parameters:
      formatArg - The format argument.
      格式参数。
      actualArg - The actual argument.
      实际参数。
      Returns:
      Whether the actual argument matches the format argument.
      实际参数是否与格式参数匹配。
    • matchesLastArgument

      private boolean matchesLastArgument(String formatArg, String actualArg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Compare the actual argument with the format argument.

      将实际参数与格式参数进行比较。

      Parameters:
      formatArg - The format argument.
      格式参数。
      actualArg - The actual argument.
      实际参数。
      Returns:
      Whether the actual argument matches the format argument.
      实际参数是否与格式参数匹配。
    • checkSender

      private boolean checkSender(org.bukkit.command.CommandSender sender)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender is valid.

      检查发送者是否有效。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      Returns:
      Whether the sender is valid.
      发送者是否有效。
    • checkSender

      private boolean checkSender(org.bukkit.command.CommandSender sender, Method method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender is valid.

      检查发送者是否有效。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      method - The method that matches the command.
      匹配命令的方法。
      Returns:
      Whether the sender is valid.
      发送者是否有效。
    • checkPermission

      private boolean checkPermission(org.bukkit.command.CommandSender sender)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender has permission.

      检查发送者是否有权限。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      Returns:
      Whether the sender has permission.
      发送者是否有权限。
    • checkPermission

      private boolean checkPermission(org.bukkit.command.CommandSender sender, Method method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender has permission.

      检查发送者是否有权限。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      method - The method that matches the command.
      匹配命令的方法。
      Returns:
      Whether the sender has permission.
      发送者是否有权限。
    • checkOp

      private boolean checkOp(org.bukkit.command.CommandSender sender)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender need to be an OP.

      检查发送者是否需要是OP。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      Returns:
      Whether the sender need to be an OP.
      发送者是否需要是OP。
    • checkOp

      private boolean checkOp(org.bukkit.command.CommandSender sender, Method method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender need to be an OP.

      检查发送者是否需要是OP。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      method - The method that matches the command.
      匹配命令的方法。
      Returns:
      Whether the sender need to be an OP.
      发送者是否需要是OP。
    • checkLock

      private boolean checkLock(org.bukkit.command.CommandSender sender, Method method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender need to wait for the previous command to finish.

      检查发送者是否需要等待上一条命令执行完毕。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      method - The method that matches the command.
      匹配命令的方法。
      Returns:
      Whether the sender need to wait for the previous command to finish.
      发送者是否需要等待上一条命令执行完毕。
    • checkCD

      private boolean checkCD(org.bukkit.command.CommandSender sender)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the sender need to wait for the command cool down.

      检查发送者是否需要等待命令冷却。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      Returns:
      Whether the sender need to wait for command cool down.
      发送者是否需要等待命令冷却。
    • buildParams

      private Object[] buildParams(String[] strings, Method method, org.bukkit.command.CommandSender commandSender)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds the parameters of the command.

      构建命令的参数。

      Parameters:
      strings - The arguments of the command.
      命令的参数。
      method - The method that matches the command.
      匹配命令的方法。
      commandSender - The sender of the command.
      命令的发送者。
      Returns:
      Parameters of the command.
      命令的参数。
    • parseType

      private <T> Object parseType(String[] value, Class<T> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parses the type of the parameter.

      解析参数的类型。

      Type Parameters:
      T - The type of the parameter.
      参数的类型。
      Parameters:
      value - The value of the parameter.
      参数的值。
      type - The type of the parameter.
      参数的类型。
      Returns:
      The parsed parameter.
      解析后的参数。
    • setCoolDown

      private void setCoolDown(org.bukkit.command.CommandSender commandSender, Method method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the cool down of the command.

      设置命令的冷却。

      Parameters:
      commandSender - The sender of the command.
      命令的发送者。
      method - The method that matches the command.
      匹配命令的方法。
    • processCoolDownTick

      protected AbstractCommandExecutor.CoolDownTickResult processCoolDownTick(UUID playerUUID, Method method, int time)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Process a single tick of the command cooldown. This method is extracted from BukkitRunnable for testability.
      Parameters:
      playerUUID - the UUID of the player
      method - the method that is on cooldown
      time - the current remaining time
      Returns:
      the result containing whether to cancel and the new remaining time
    • executeMethodWithLock

      protected void executeMethodWithLock(org.bukkit.command.CommandSender commandSender, Method method, Object[] params)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a method with usage limit lock handling. This method is extracted from BukkitRunnable for testability.
      Parameters:
      commandSender - the sender of the command
      method - the method to execute
      params - the parameters to pass to the method
    • handleHelp

      protected abstract void handleHelp(org.bukkit.command.CommandSender sender)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Abstract method that handles the help command.

      处理帮助命令的抽象方法。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
    • sendErrorMessage

      protected void sendErrorMessage(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sends the error message.

      发送错误信息。

      Parameters:
      sender - The sender of the command.
      命令的发送者。
      command - The command that was executed.
      执行的命令。
    • suggest

      protected List<String> suggest(org.bukkit.entity.Player player, org.bukkit.command.Command command, String[] strings)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tab complete method. Returns a list of possible completions for the specified command string. By rewriting this method, you can customize the tab completion of the command.

      补全方法。返回指定命令字符串的可能补全列表。 通过重写此方法,您可以自定义命令的补全。

      Parameters:
      player - The player who will see the suggestions.
      看到补全的玩家
      command - The command that was typed in.
      需要补全的命令
      strings - The arguments of the command that was typed in.
      目前输入的命令参数
      Returns:
      The suggestions.
      补全的建议
    • getArgSuggestion

      private void getArgSuggestion(org.bukkit.entity.Player player, org.bukkit.command.Command command, String[] strings, Method method, String arg, List<String> completions)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds suggestion to the list of suggestions. This method is called by the suggest method. Fetch the suggestions by invoking the given method.

      将建议添加到建议列表中。此方法由suggest方法调用。 通过调用给定的方法获取建议。

      Parameters:
      player - The player who will see the suggestions.
      看到补全的玩家
      command - The command that was typed in.
      需要补全的命令
      strings - The arguments of the command that was typed in.
      目前输入的命令参数
      method - The method that matches the command.
      匹配命令的方法。
      arg - The argument that needs to be completed.
      需要补全的参数。
      completions - The suggestions.
      补全的建议
    • getFormatByMethod

      private String getFormatByMethod(Method method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the format of the command.

      获取命令的格式。

      Parameters:
      method - The method that matches the command.
      匹配命令的方法。
      Returns:
      The format of the command.
      命令的格式。
    • getArgAt

      private String getArgAt(String format, int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the argument at the specified index.

      获取指定索引处的参数。

      Parameters:
      format - The format of the command.
      命令的格式。
      index - The index of the argument.
      参数的索引。
      Returns:
      The argument at the specified index.
      指定索引处的参数。
    • getSuggestName

      private String getSuggestName(Method method, String paramName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the suggest method name of the parameter.

      获取参数的建议方法名称。

      Parameters:
      method - The method that matches the command.
      匹配命令的方法。
      paramName - The name of the parameter.
      参数的名称。
      Returns:
      The suggest method name of the parameter.
      参数的建议方法名称。
    • getSuggestMethodByName

      private Method[] getSuggestMethodByName(String suggestName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the suggest method array by the suggest method name. If the suggest method name ends with (), remove (). Get the suggest method array from the current class first. If the current class has the CmdSuggest annotation, get the suggest method array from the CmdSuggest annotation.

      通过建议方法名称获取建议方法数组。 如果建议方法名称以()结尾,则去掉()。 优先从当前类中获取建议方法集合。 如果当前类上有CmdSuggest注解,则从CmdSuggest注解中获取建议方法集合。

      Parameters:
      suggestName - The name of the suggest method.
      建议方法的名称
      Returns:
      The suggest method array.
      建议方法数组
    • getMethod

      @Nullable private Method[] getMethod(String suggestName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the suggest method array by the suggest method name.

      通过建议方法名称获取建议方法数组。

      Parameters:
      suggestName - The name of the suggest method.
      建议方法的名称
      Returns:
      The suggest method array.
      建议方法数组
    • getMethod

      @Nullable private Method[] getMethod(Class<?> clazz, String suggestName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the suggest method array by the suggest method name from another class.

      从另一个类中通过方法名称获取方法数组。

      Parameters:
      clazz - The class of the suggest method.
      建议方法的类
      suggestName - The name of the suggest method.
      建议方法的名称
      Returns:
      The suggest method array.
      建议方法数组
    • invokeSuggestMethod

      private Collection<?> invokeSuggestMethod(Object object, Method method, org.bukkit.entity.Player player, org.bukkit.command.Command command, String[] strings)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invokes the suggest method. Inject parameters by parameter type.

      调用建议方法。按照参数类型注入参数。

      Parameters:
      object - The object that the method is invoked from.
      方法所在的对象。
      method - The method that is invoked.
      被调用的方法。
      player - The player who will see the suggestions.
      看到补全的玩家
      command - The command that was typed in.
      需要补全的命令
      strings - The arguments of the command that was typed in.
      目前输入的命令参数
      Returns:
      The return string list of suggestions of the method.
      方法的返回字符串列表。
    • getMethodsByArg

      private List<Method> getMethodsByArg(org.bukkit.entity.Player player, String command)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the methods that match the command. Get the perfect match method first. If there is no perfect match method, get the partial match method. If there is no perfect match method and partial match method, return an empty list. If there is a perfect match method, only return the perfect match method.

      获取匹配命令的方法。 优先获取完全匹配的方法,如果没有完全匹配的方法,则获取部分匹配的方法。 如果没有完全匹配的方法和部分匹配的方法,则返回空列表。 如果有完全匹配的方法,则只返回完全匹配的方法。

      Parameters:
      player - The player who will see the suggestions.
      看到补全的玩家
      command - The command that was typed in.
      需要补全的命令
      Returns:
      The suggestions.
      补全的建议
    • getHelpCommand

      protected String getHelpCommand()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The help command.
      帮助命令。
      See Also:
    • onCommand

      public boolean onCommand(org.bukkit.command.CommandSender commandSender, org.bukkit.command.Command command, String s, String[] strings)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Executes the command, returning its success.

      执行命令,返回是否成功。

      Specified by:
      onCommand in interface org.bukkit.command.CommandExecutor
      Parameters:
      commandSender - Source of the command
      命令的发送者
      command - Command which was executed
      命令
      s - Alias of the command which was used
      命令的别名
      strings - Passed command arguments
      命令的参数
      Returns:
      true if a valid command, otherwise false
      如果是有效的命令则返回true,否则返回false
    • checkParameters

      private boolean checkParameters(String[] args, Method method, org.bukkit.command.CommandSender commandSender, org.bukkit.command.Command command)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onTabComplete

      @Nullable public List<String> onTabComplete(org.bukkit.command.CommandSender commandSender, org.bukkit.command.Command command, String s, String[] strings)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Requests a list of possible completions for a command argument.

      请求命令参数的可能补全列表。

      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter
      Parameters:
      commandSender - Source of the command. For players tab-completing a command inside of a command block, this will be the player, not the command block.
      command - Command which was executed
      s - Alias of the command which was used
      strings - The arguments passed to the command, including final partial argument to be completed
      Returns:
      A List of possible completions for the final argument, or null