package com.github.lunatrius.schematica;

import com.github.lunatrius.core.version.VersionChecker;
import com.github.lunatrius.schematica.handler.ConfigurationHandler;
import com.github.lunatrius.schematica.lib.Reference;
import com.github.lunatrius.schematica.proxy.CommonProxy;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = Reference.MODID, name = Reference.NAME, guiFactory = Reference.GUI_FACTORY)
public class Schematica {
	@Instance(Reference.MODID)
	public static Schematica instance;

	@SidedProxy(serverSide = Reference.PROXY_SERVER, clientSide = Reference.PROXY_CLIENT)
	public static CommonProxy proxy;

	@EventHandler
	public void preInit(FMLPreInitializationEvent event) {
		VersionChecker.registerMod(event.getModMetadata(), Reference.FORGE);

		Reference.logger = event.getModLog();

		ConfigurationHandler.init(event.getSuggestedConfigurationFile());
		proxy.setConfigEntryClasses();

		proxy.registerKeybindings();
		proxy.createFolders();
	}

	@EventHandler
	public void init(FMLInitializationEvent event) {
		try {
			proxy.registerEvents();
		} catch (Exception e) {
			Reference.logger.fatal("Could not initialize the mod!", e);
			throw new RuntimeException(e);
		}
	}

	@EventHandler
	public void postInit(FMLPostInitializationEvent event) {
	}
}

@@ -986,80 +986,8 @@
 ) %7B%0A
-%09%09VersionChecker.registerMod(event.getModMetadata(), Reference.FORGE);%0A%0A
 %09%09Re
@@ -1022,17 +1022,16 @@
 dLog();%0A
-%0A
 %09%09Config
@@ -1179,16 +1179,88 @@
 lders();
+%0A%0A%09%09VersionChecker.registerMod(event.getModMetadata(), Reference.FORGE);
 %0A%09%7D%0A%0A%09@E

Move the version checker registration to the end of preInit, make sure the logger is initialized first.