public void loadConfig(ConfigurationSection config){
  ConfigurationSection general=config.getConfigurationSection("general-topics");
  if (general != null) {
    for (    String key : general.getKeys(false)) {
      ConfigurationSection topic=general.getConfigurationSection(key);
      if (topic != null) {
        String shortText=topic.getString("shortText","");
        String fullText=topic.getString("fullText","");
        if (!shortText.isEmpty()) {
          if (fullText.isEmpty()) {
            fullText=shortText;
          }
 else {
            fullText=shortText + "\n" + ChatColor.RESET+ fullText;
          }
        }
        addTopic(new GeneralHelpTopic(key,color(shortText),color(fullText),topic.getString("permission",null)));
      }
    }
  }
  ConfigurationSection index=config.getConfigurationSection("index-topics");
  if (index != null) {
    for (    String key : index.getKeys(false)) {
      ConfigurationSection topic=index.getConfigurationSection(key);
      if (topic != null) {
        String shortText=color(topic.getString("shortText",""));
        String preamble=color(topic.getString("preamble",null));
        String permission=topic.getString("permission",null);
        HelpTopic helpTopic=new LazyIndexTopic(key,shortText,permission,topic.getStringList("commands"),preamble);
        if (key.equals("Default")) {
          defaultTopic=helpTopic;
        }
 else {
          addTopic(helpTopic);
        }
      }
    }
  }
  ignoredPlugins.addAll(config.getStringList("ignore-plugins"));
  commandsInIndex=config.getBoolean("command-topics-in-master-index",true);
}

public void loadConfig ( ConfigurationSection config ) { ConfigurationSection general = config . getConfigurationSection ( "general-topics" ) ; if ( general != null ) { for ( String key : general . getKeys ( false ) ) { ConfigurationSection topic = general . getConfigurationSection ( key ) ; if ( topic != null ) { String shortText = topic . getString ( "shortText" , "" ) ; String fullText = topic . getString ( "fullText" , "" ) ; if ( ! shortText . isEmpty ( ) ) { if ( fullText . isEmpty ( ) ) { fullText = shortText ; } else { fullText = shortText + "\n" + ChatColor . RESET + fullText ; } } addTopic ( new GeneralHelpTopic ( key , color ( shortText ) , color ( fullText ) , topic . getString ( "permission" , null ) ) ) ; } } } ConfigurationSection index = config . getConfigurationSection ( "index-topics" ) ; if ( index != null ) { for ( String key : index . getKeys ( false ) ) { ConfigurationSection topic = index . getConfigurationSection ( key ) ; if ( topic != null ) { String shortText = color ( topic . getString ( "shortText" , "" ) ) ; String preamble = color ( topic . getString ( "preamble" , null ) ) ; String permission = topic . getString ( "permission" , null ) ; HelpTopic helpTopic = new LazyIndexTopic ( key , shortText , permission , topic . getStringList ( "commands" ) , preamble ) ; if ( key . equals ( "Default" ) ) { defaultTopic = helpTopic ; } else { addTopic ( helpTopic ) ; } } } } ignoredPlugins . addAll ( config . getStringList ( "ignore-plugins" ) ) ; commandsInIndex = config . getBoolean ( "command-topics-in-master-index" , true ) ; }
reads the general topics from help . yml and adds them to the help index .
