use of fr.xephi.authme.command.CommandInitializer in project AuthMeReloaded by AuthMe.
the class HelpMessagesConsistencyTest method getAuthMeRegisterDescription.
/**
* @return the CommandDescription object for the {@code /authme register} command.
*/
private static CommandDescription getAuthMeRegisterDescription() {
Collection<CommandDescription> commands = new CommandInitializer().getCommands();
List<CommandDescription> children = commands.stream().filter(command -> command.getLabels().contains("authme")).map(CommandDescription::getChildren).findFirst().get();
return children.stream().filter(child -> child.getLabels().contains("register")).findFirst().get();
}
use of fr.xephi.authme.command.CommandInitializer in project AuthMeReloaded by AuthMe.
the class GeneratePluginYml method generateCommands.
private static Map<String, Object> generateCommands() {
Collection<CommandDescription> commands = new CommandInitializer().getCommands();
Map<String, Object> entries = new LinkedHashMap<>();
for (CommandDescription command : commands) {
entries.put(command.getLabels().get(0), buildCommandEntry(command));
}
return entries;
}
use of fr.xephi.authme.command.CommandInitializer in project AuthMeReloaded by AuthMe.
the class HelpTranslationVerifier method buildCommandPaths.
private Set<String> buildCommandPaths() {
Set<String> commandPaths = new LinkedHashSet<>();
for (CommandDescription command : new CommandInitializer().getCommands()) {
commandPaths.addAll(getYamlPaths(command));
command.getChildren().forEach(child -> commandPaths.addAll(getYamlPaths(child)));
}
return commandPaths;
}
use of fr.xephi.authme.command.CommandInitializer in project AuthMeReloaded by AuthMe.
the class CommandPageCreater method executeDefault.
@Override
public void executeDefault() {
CommandInitializer commandInitializer = new CommandInitializer();
final Collection<CommandDescription> baseCommands = commandInitializer.getCommands();
NestedTagValue commandTags = new NestedTagValue();
addCommandsInfo(commandTags, baseCommands);
FileIoUtils.generateFileFromTemplate(ToolsConstants.TOOLS_SOURCE_ROOT + "docs/commands/commands.tpl.md", OUTPUT_FILE, TagValueHolder.create().put("commands", commandTags));
System.out.println("Wrote to '" + OUTPUT_FILE + "' with " + baseCommands.size() + " base commands.");
}
Aggregations