/** Reads the general topics from help.yml and adds them to the help index. */ public synchronized void initializeGeneralTopics() { yaml = new HelpYamlReader(server); // Initialize general help topics from the help.yml file for (HelpTopic topic : yaml.getGeneralTopics()) { addTopic(topic); } // Initialize index help topics from the help.yml file for (HelpTopic topic : yaml.getIndexTopics()) { if (topic.getName().equals("Default")) { defaultTopic = topic; } else { addTopic(topic); } } }
public synchronized void addTopic(HelpTopic topic) { // Existing topics take priority if (!helpTopics.containsKey(topic.getName())) { helpTopics.put(topic.getName(), topic); } }
public boolean apply(HelpTopic topic) { return topic.getName().charAt(0) == '/'; }