Class AbstractCommand

java.lang.Object
com.ultikits.ultitools.abstracts.AbstractCommand
All Implemented Interfaces:
org.bukkit.command.CommandExecutor
Direct Known Subclasses:
AbstractConsoleCommandExecutor, AbstractPlayerCommandExecutor

public abstract class AbstractCommand extends Object implements org.bukkit.command.CommandExecutor
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    Gets the help command.
    protected void
    sendErrorMessage(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command)
    Sends the error message to the sender of the command.
    protected abstract void
    sendHelpMessage(org.bukkit.command.CommandSender sender)
    Sends the help message to the sender of the command.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.bukkit.command.CommandExecutor

    onCommand
  • Constructor Details

    • AbstractCommand

      public AbstractCommand()
  • Method Details

    • sendHelpMessage

      protected abstract void sendHelpMessage(org.bukkit.command.CommandSender sender)
      Sends the help message to the sender of the command.

      发送帮助信息给指令发送者。

      Parameters:
      sender - the sender of the command
      指令发送者
    • sendErrorMessage

      protected void sendErrorMessage(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command)
      Sends the error message to the sender of the command.

      发送错误信息给指令发送者。

      Parameters:
      sender - the sender of the command
      指令发送者
      command - the command which was executed
      被执行的指令
    • getHelpCommand

      protected String getHelpCommand()
      Gets the help command.
      For example "warp help", if you like to change the help command to "warp h", you can override this method and make this method return "h".

      获取帮助指令。
      例如"warp help",如果你想把帮助指令改成"warp h",你可以重写这个方法,让这个方法返回"h"。

      Returns:
      the help command
      帮助指令