程序包 org.bukkit.help

接口 HelpMap


public interface HelpMap
HelpMap跟踪所有注册在Bukkit服务器的帮助主题。 当服务器启动或重新加载时,按以下顺序处理帮助和添加内容:
  1. 从help.yml加载总主题
  2. 插件加载并可选择调用addTopic()添加主题
  3. 使用HelpTopicFactory帮助主题工厂对象的注册插件命令,来创建主题
  4. 主题内容被修改为指向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:

  1. General topics are loaded from the help.yml
  2. Plugins load and optionally call addTopic()
  3. Registered plugin commands are processed by HelpTopicFactory objects to create topics
  4. Topic contents are amended as directed in help.yml
  • 方法详细资料

    • getHelpTopic

      HelpTopic getHelpTopic(String topicName)
      获取指定主题名称的帮助主题。

      原文: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

      void addTopic(HelpTopic topic)
      把主题添加到服务器的帮助索引。

      原文: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

      void registerHelpTopicFactory(Class<?> commandClass, HelpTopicFactory<?> factory)
      关联一个HelpTopicFactory对象到指定的命令基类。 插件通常在onLoad()中调用此方法。 注册后,自定义HelpTopicFactory将用来创建一个所有命令源于commandClass基类的自定义HelpTopic, 或者所有命令源于org.bukkit.command.PluginCommand中执行源于commandClass基类的那个类。

      原文:Associates a HelpTopicFactory object with given command base class. Plugins typically call this method during onLoad(). Once registered, the custom HelpTopicFactory will be used to create a custom HelpTopic for all commands deriving from the commandClass base class, or all commands deriving from PluginCommand who's executor derives from commandClass 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 or CommandExecutor.

      factory - HelpTopicFactory的实现于commandClass相关联。

      原文:The HelpTopicFactory implementation to associate with the commandClass.

      抛出:
      IllegalArgumentException - 如果commandClass不是继承一个合法的基类

      原文:Thrown if commandClass does not derive from a legal base class.

    • getIgnoredPlugins

      List<String> 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 of PluginCommand will need to check this collection in their HelpTopicFactory implementations to ensure they meet the server administrator's expectations.

      返回:
      一个应该被排除在帮助索引之外的插件列表。