diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-10 01:10:39 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-10 01:40:22 -0600 |
commit | 22b11000017a245a944c8f4d367977772b27bac1 (patch) | |
tree | b5e54bd259c5eee61921213df270b842a185a5f1 | |
parent | dc93da8e34af96b793d9a4f4f43d4b9109bdb303 (diff) | |
download | craftbukkit-22b11000017a245a944c8f4d367977772b27bac1.tar craftbukkit-22b11000017a245a944c8f4d367977772b27bac1.tar.gz craftbukkit-22b11000017a245a944c8f4d367977772b27bac1.tar.lz craftbukkit-22b11000017a245a944c8f4d367977772b27bac1.tar.xz craftbukkit-22b11000017a245a944c8f4d367977772b27bac1.zip |
Only display help aliases when there are aliases. Fixes BUKKIT-1621
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java b/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java index 12c9dd7b..d286b1c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java +++ b/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java @@ -80,7 +80,7 @@ public class SimpleHelpMap implements HelpMap { 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")) { @@ -97,7 +97,7 @@ public class SimpleHelpMap implements HelpMap { public synchronized void initializeCommands() { // ** Load topics from highest to lowest priority order ** Set<String> ignoredPlugins = new HashSet<String>(yaml.getIgnoredPlugins()); - + // Don't load any automatic help topics if All is ignored if (ignoredPlugins.contains("All")) { return; @@ -145,7 +145,10 @@ public class SimpleHelpMap implements HelpMap { } // Add alias sub-index - addTopic(new IndexHelpTopic("Aliases", "Lists command aliases", null, Collections2.filter(helpTopics.values(), Predicates.instanceOf(CommandAliasHelpTopic.class)))); + Collection<HelpTopic> filteredTopics = Collections2.<HelpTopic>filter(helpTopics.values(), Predicates.instanceOf(CommandAliasHelpTopic.class)); + if (!filteredTopics.isEmpty()) { + addTopic(new IndexHelpTopic("Aliases", "Lists command aliases", null, filteredTopics)); + } // Initialize plugin-level sub-topics Map<String, Set<HelpTopic>> pluginIndexes = new HashMap<String, Set<HelpTopic>>(); |