Mechanic mechanic = (Mechanic) ((SpongeModuleWrapper) module).getModuleUnchecked(); if(mechanic instanceof DocumentationProvider) DocumentationGenerator.generateDocumentation((DocumentationProvider) mechanic); } catch (ModuleNotInstantiatedException e) { logger.error("Failed to generate docs for module: " + module.getName(), e); DocumentationGenerator.generateDocumentation(config);
@Override public CommandResult execute(CommandSource src, CommandContext args) throws CommandException { for (ModuleWrapper module : CraftBookPlugin.spongeInst().moduleController.getModules()) { if(!module.isEnabled()) continue; try { Mechanic mechanic = (Mechanic) ((SpongeModuleWrapper) module).getModuleUnchecked(); if(mechanic instanceof DocumentationProvider) DocumentationGenerator.generateDocumentation((DocumentationProvider) mechanic); } catch (ModuleNotInstantiatedException e) { CraftBookPlugin.spongeInst().getLogger().error("Failed to generate docs for module: " + module.getName(), e); } } DocumentationGenerator.generateDocumentation(CraftBookPlugin.spongeInst().getConfig()); return CommandResult.success(); } }