mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 18:07:39 +01:00
Only display help aliases when there are aliases. Fixes BUKKIT-1621
This commit is contained in:
parent
dc93da8e34
commit
22b1100001
@ -80,7 +80,7 @@ public class SimpleHelpMap implements HelpMap {
|
|||||||
for (HelpTopic topic : yaml.getGeneralTopics()) {
|
for (HelpTopic topic : yaml.getGeneralTopics()) {
|
||||||
addTopic(topic);
|
addTopic(topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize index help topics from the help.yml file
|
// Initialize index help topics from the help.yml file
|
||||||
for (HelpTopic topic : yaml.getIndexTopics()) {
|
for (HelpTopic topic : yaml.getIndexTopics()) {
|
||||||
if (topic.getName().equals("Default")) {
|
if (topic.getName().equals("Default")) {
|
||||||
@ -97,7 +97,7 @@ public class SimpleHelpMap implements HelpMap {
|
|||||||
public synchronized void initializeCommands() {
|
public synchronized void initializeCommands() {
|
||||||
// ** Load topics from highest to lowest priority order **
|
// ** Load topics from highest to lowest priority order **
|
||||||
Set<String> ignoredPlugins = new HashSet<String>(yaml.getIgnoredPlugins());
|
Set<String> ignoredPlugins = new HashSet<String>(yaml.getIgnoredPlugins());
|
||||||
|
|
||||||
// Don't load any automatic help topics if All is ignored
|
// Don't load any automatic help topics if All is ignored
|
||||||
if (ignoredPlugins.contains("All")) {
|
if (ignoredPlugins.contains("All")) {
|
||||||
return;
|
return;
|
||||||
@ -145,7 +145,10 @@ public class SimpleHelpMap implements HelpMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add alias sub-index
|
// 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
|
// Initialize plugin-level sub-topics
|
||||||
Map<String, Set<HelpTopic>> pluginIndexes = new HashMap<String, Set<HelpTopic>>();
|
Map<String, Set<HelpTopic>> pluginIndexes = new HashMap<String, Set<HelpTopic>>();
|
||||||
|
Loading…
Reference in New Issue
Block a user