类 PluginCommand
- 所有已实现的接口:
PluginIdentifiableCommand
命令
.-
字段概要
从类继承的字段 org.bukkit.command.Command
description, timings, usageMessage
-
构造器概要
-
方法概要
修饰符和类型方法说明boolean
执行一个命令.获取与这个命令关联的CommandExecutor
.获取拥有这个PluginCommand的插件.获取与这个命令关联的TabCompleter
.void
setExecutor
(@Nullable CommandExecutor executor) 设置当命令解析时运行的CommandExecutor
.void
setTabCompleter
(@Nullable TabCompleter completer) 设置当(玩家)进行命令补全时执行的TabCompleter
.tabComplete
(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) 对此命令进行tab补全并返回补全项列表.toString()
从类继承的方法 org.bukkit.command.Command
broadcastCommandMessage, broadcastCommandMessage, getAliases, getDescription, getLabel, getName, getPermission, getPermissionMessage, getUsage, isRegistered, register, setAliases, setDescription, setLabel, setName, setPermission, setPermissionMessage, setUsage, tabComplete, testPermission, testPermissionSilent, unregister
-
构造器详细资料
-
PluginCommand
-
-
方法详细资料
-
execute
public boolean execute(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String commandLabel, @NotNull @NotNull String[] args) 执行一个命令.原文:Executes the command, returning its success
-
setExecutor
设置当命令解析时运行的CommandExecutor
.原文:Sets the
CommandExecutor
to run when parsing this command- 参数:
executor
- 要运行的新Executor
-
getExecutor
获取与这个命令关联的CommandExecutor
.原文:Gets the
CommandExecutor
associated with this command- 返回:
- 这个命令关联的
CommandExecutor
-
setTabCompleter
设置当(玩家)进行命令补全时执行的TabCompleter
.如果没有指定 TabCompleter,这个命令执行器实现了TabCompleter,执行器将用来做命令补全.
原文:Sets the
TabCompleter
to run when tab-completing this command.If no TabCompleter is specified, and the command's executor implements TabCompleter, then the executor will be used for tab completion.
- 参数:
completer
- 新的TabComplete
-
getTabCompleter
获取与这个命令关联的TabCompleter
.原文:Gets the
TabCompleter
associated with this command.- 返回:
- 与这个命令关联的
TabCompleter
-
getPlugin
获取拥有这个PluginCommand的插件.原文:Gets the owner of this PluginCommand
- 指定者:
getPlugin
在接口中PluginIdentifiableCommand
- 返回:
- 拥有这个命令的插件
-
tabComplete
@NotNull public List<String> tabComplete(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String alias, @NotNull @NotNull String[] args) throws CommandException, IllegalArgumentException 对此命令进行tab补全并返回补全项列表.原文:Executed on tab completion for this command, returning a list of options the player can tab through.
委托的tab补全器(如果存在).
如果它不存在或者返回null,将委托给当前命令的执行器如果它实现了
TabCompleter
.如果找不到非null的list,将默认在Command.tabComplete(CommandSender, String, String[])
里使用玩家名字.这个方法不会判断权限.
原文:Delegates to the tab completer if present.
If it is not present or returns null, will delegate to the current command executor if it implements
TabCompleter
. If a non-null list has not been found, will default to standard player name completion inCommand.tabComplete(CommandSender, String, String[])
.This method does not consider permissions.
- 覆盖:
tabComplete
在类中Command
- 参数:
sender
- 执行此命令的对象alias
- 执行命令所用的别名args
- 传递给此命令的所有参数,用' '分割- 返回:
- 指定参数的tab补全项列表.列表永远不会为null. 列表可能是不可变的.
- 抛出:
CommandException
- 如果补全器或执行器在补全过程中抛出了异常IllegalArgumentException
- 如果参数sender, alias, 或 args 是null
-
toString
-