接口 HelpMap
- 从help.yml加载总主题
- 插件加载并可选择调用
addTopic()
添加主题 - 使用
HelpTopicFactory
帮助主题工厂对象的注册插件命令,来创建主题 - 主题内容被修改为指向help.yml
原文:The HelpMap tracks all help topics registered in a Bukkit server. When the server starts up or is reloaded, help is processed and topics are added in the following order:
- General topics are loaded from the help.yml
- Plugins load and optionally call
addTopic()
- Registered plugin commands are processed by
HelpTopicFactory
objects to create topics - Topic contents are amended as directed in help.yml
-
方法概要
修饰符和类型方法说明void
把主题添加到服务器的帮助索引。void
clear()
清除帮助索引的内容。getHelpTopic
(String topicName) 获取指定主题名称的帮助主题。获得所有注册过的帮助主题集合。获取服务器管理者选择从帮助索引中排除的插件列表。void
registerHelpTopicFactory
(Class<?> commandClass, HelpTopicFactory<?> factory) 关联一个HelpTopicFactory对象到指定的命令基类。
-
方法详细资料
-
getHelpTopic
获取指定主题名称的帮助主题。原文:Returns a help topic for a given topic name.
- 参数:
topicName
- 按名称查找帮助主题。- 返回:
- 如果有则为返回
HelpTopic
对象,如果没有则返回null。
-
getHelpTopics
Collection<HelpTopic> getHelpTopics()获得所有注册过的帮助主题集合。原文:Returns a collection of all the registered help topics.
- 返回:
- 所有注册过的帮助主题。
-
addTopic
把主题添加到服务器的帮助索引。原文:Adds a topic to the server's help index.
- 参数:
topic
- 要添加的帮助主题.
-
clear
void clear()清除帮助索引的内容。通常在服务器重新加载时调用。原文:Clears out the contents of the help index. Normally called during server reload.
-
registerHelpTopicFactory
关联一个HelpTopicFactory对象到指定的命令基类。 插件通常在onLoad()中调用此方法。 注册后,自定义HelpTopicFactory将用来创建一个所有命令源于commandClass基类的自定义HelpTopic, 或者所有命令源于org.bukkit.command.PluginCommand中执行源于commandClass基类的那个类。原文:Associates a
HelpTopicFactory
object with given command base class. Plugins typically call this method duringonLoad()
. Once registered, the custom HelpTopicFactory will be used to create a customHelpTopic
for all commands deriving from thecommandClass
base class, or all commands deriving fromPluginCommand
who's executor derives fromcommandClass
base class.- 参数:
commandClass
- 用于自定义HelpTopicFactory泛型。 必须继承org.bukkit.command.Command或org.bukkit.command.CommandExecutor原文:The class for which the custom HelpTopicFactory applies. Must derive from either
Command
orCommandExecutor
.factory
- HelpTopicFactory的实现于commandClass相关联。原文:The
HelpTopicFactory
implementation to associate with thecommandClass
.- 抛出:
IllegalArgumentException
- 如果commandClass不是继承一个合法的基类原文:Thrown if
commandClass
does not derive from a legal base class.
-
getIgnoredPlugins
获取服务器管理者选择从帮助索引中排除的插件列表。 想确保完成服务器管理者的预期, 插件作者需要查看实现HelpTopicFactory的集合来选择直接继承org.bukkit.command.Command而不是PluginCommand。原文:Gets the list of plugins the server administrator has chosen to exclude from the help index. Plugin authors who choose to directly extend
Command
instead ofPluginCommand
will need to check this collection in theirHelpTopicFactory
implementations to ensure they meet the server administrator's expectations.- 返回:
- 一个应该被排除在帮助索引之外的插件列表。
-