use of fr.xephi.authme.command.help.HelpMessage in project AuthMeReloaded by AuthMe.
the class HelpTranslationGenerator method generateHelpMessageEntries.
/**
* Generates entries for a complete help text file.
*
* @return help text entries to save
*/
private Map<String, Object> generateHelpMessageEntries() {
Map<String, Object> messageEntries = new LinkedHashMap<>(HelpMessage.values().length);
for (HelpMessage message : HelpMessage.values()) {
messageEntries.put(message.getEntryKey(), helpMessagesService.getMessage(message));
}
Map<String, String> defaultPermissions = new LinkedHashMap<>();
for (DefaultPermission defaultPermission : DefaultPermission.values()) {
defaultPermissions.put(HelpMessagesService.getDefaultPermissionsSubPath(defaultPermission), helpMessagesService.getMessage(defaultPermission));
}
messageEntries.put("defaultPermissions", defaultPermissions);
Map<String, String> sectionEntries = new LinkedHashMap<>(HelpSection.values().length);
for (HelpSection section : HelpSection.values()) {
sectionEntries.put(section.getEntryKey(), helpMessagesService.getMessage(section));
}
Map<String, Object> commandEntries = new LinkedHashMap<>();
for (CommandDescription command : commandInitializer.getCommands()) {
generateCommandEntries(command, commandEntries);
}
return ImmutableMap.of("common", messageEntries, "section", sectionEntries, "commands", commandEntries);
}
Aggregations