try {
File output = new File(filename);
if (!output.isAbsolute()) output = new File(OpenMods.proxy.getMinecraftDir(), filename);
DocBuilder builder = new DocBuilder();
for (Map.Entry<Class<?>, ClassMethodsList<IPeripheralMethodExecutor>> e : AdapterManager.peripherals.listCollectedClasses().entrySet())
builder.createDocForTe(e.getKey(), e.getValue());
for (Map.Entry<Class<?>, ClassMethodsList<IObjectMethodExecutor>> e : AdapterManager.objects.listCollectedClasses().entrySet())
builder.createDocForObject(e.getKey(), e.getValue());
for (IAdapterMethodsList<?> e : AdapterManager.peripherals.listExternalAdapters())
builder.createDocForPeripheral("peripheralAdapter", e);
for (IAdapterMethodsList<?> e : AdapterManager.objects.listExternalAdapters())
builder.createDocForPeripheral("objectAdapter", e);
builder.dump(output);
sender.addChatMessage(new ChatComponentText("Done! Created file in " + output.getAbsolutePath()));
} catch (Throwable t) {
Log.warn(t, "Failed to execute dump command");
sender.addChatMessage(new ChatComponentText("Failed to execute! Check logs"));