类 BasicCommand

java.lang.Object
top.shjibi.plugineer.command.base.BasicCommand
所有已实现的接口:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor
直接已知子类:
PlayerCommand

public abstract class BasicCommand extends Object implements org.bukkit.command.TabExecutor
基本的指令
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected final int
     
    protected final @NotNull String
     
    protected final @NotNull org.bukkit.plugin.java.JavaPlugin
     
    protected final @NotNull String[]
     
  • 构造器概要

    构造器
    构造器
    说明
    BasicCommand(@NotNull org.bukkit.plugin.java.JavaPlugin plugin)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    @Nullable List<String>
    completeTab(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)
    决定tab列表中出现哪些词
    abstract void
    execute(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)
    决定执行指令出现的效果
    int
    获取指令所需的最少参数
    @NotNull String
    获取指令名字
    @NotNull String[]
    获取指令用法
    final boolean
    onCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, String[] args)
     
    final List<String>
    onTabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, String[] args)
     
    void
    注册指令
    protected final void
    sendUsage(@NotNull org.bukkit.command.CommandSender sender, Object... replacement)
    向指令发送者发送指令的正确用法

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • plugin

      @NotNull protected final @NotNull org.bukkit.plugin.java.JavaPlugin plugin
    • name

      @NotNull protected final @NotNull String name
    • minArgs

      protected final int minArgs
    • usage

      @NotNull protected final @NotNull String[] usage
  • 构造器详细资料

    • BasicCommand

      public BasicCommand(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin)
  • 方法详细资料

    • register

      public void register()
      注册指令
    • sendUsage

      protected final void sendUsage(@NotNull @NotNull org.bukkit.command.CommandSender sender, Object... replacement)
      向指令发送者发送指令的正确用法
    • onCommand

      public final boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, String[] args)
      指定者:
      onCommand 在接口中 org.bukkit.command.CommandExecutor
    • onTabComplete

      public final List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, String[] args)
      指定者:
      onTabComplete 在接口中 org.bukkit.command.TabCompleter
    • completeTab

      @Nullable public @Nullable List<String> completeTab(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args)
      决定tab列表中出现哪些词
    • execute

      public abstract void execute(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args)
      决定执行指令出现的效果
    • getName

      @NotNull public @NotNull String getName()
      获取指令名字
    • getMinArgs

      public int getMinArgs()
      获取指令所需的最少参数
    • getUsage

      @NotNull public @NotNull String[] getUsage()
      获取指令用法