package com.roborave.edm.tweaker;

import java.util.Arrays;

import net.minecraft.init.Blocks;
import net.minecraftforge.common.config.Configuration;

import com.roborave.edm.tweaker.config.MCConfiguration;
import com.roborave.edm.tweaker.helper.LogHelper;
import com.roborave.edm.tweaker.helper.ObfHelper;
import com.roborave.edm.tweaker.packager.Packager;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@Packager(getName=Main.NAME, getVersion=Main.VERSION,getBaseDirectories = { "com.roborave.edm" }, getClasses = { "com.roborave" })
@Mod(modid = Main.MODID, version = Main.VERSION,name=Main.NAME)
public class Main
{
	@Mod.Instance(value=Main.MODID)
	public Main instance;
	
	@Mod.Metadata(Main.MODID)
	public ModMetadata meta;

	public static boolean hardMode;

	private String descriptionDEV="turn this on for hard mode which will make the swords unenchanted. WIP";

	private boolean test=false;
    
	public static final String MODID = "Tweaker";
    public static final String VERSION = "0.2.5";
    public static final String NAME="edmtweaker";
    
    @Mod.EventHandler
    public void PreInit(FMLPreInitializationEvent event)
    {
    	meta = event.getModMetadata();
		meta.autogenerated = false;
		meta.credits = "(C) Roborave, 2014";
		meta.authorList = Arrays.asList("Roborave");
		meta.modId=MODID;
		meta.name=NAME;
		meta.version=VERSION;
		//meta.description="EDM";
		
		MCConfiguration.CreateConfig(event, Main.MODID, Main.NAME.toUpperCase());
		Main.hardMode = MCConfiguration.config.getBoolean(Configuration.CATEGORY_GENERAL, "HardMode", this.test, this.descriptionDEV);
		MCConfiguration.config.save();
		
		if(ObfHelper.isObfuscatedEnv()==false){
			LogHelper.info("Found Obfuscated Envorment", new Object[0]);
			try {
				LogHelper.info("%s", Blocks.class.getField("air").toString());
			} catch (NoSuchFieldException e) {
				e.printStackTrace();
			} catch (SecurityException e) {
				e.printStackTrace();
			}
		}
    }
    
    @EventHandler
    public void Postinit(FMLPostInitializationEvent event)
    {
    	if(Loader.isModLoaded("Extra_Diamonds_Mod"))
    	{
    		try{
    			Tweaker.load();
    		}catch (Exception e){
    			e.printStackTrace();
		}
    	}
    }
}

@@ -1173,20 +1173,17 @@
 eaker%22;%0A
-    
+%09
 public s
@@ -1220,16 +1220,17 @@
 0.2.
-5
+8
 %22;%0A    
+%09
 publ
@@ -1397,17 +1397,16 @@
 data();%0A
-%09
 %09meta.au
@@ -1426,17 +1426,16 @@
  false;%0A
-%09
 %09meta.cr
@@ -1450,27 +1450,20 @@
 %22(C)
- Roborave, 2014
+2014-2015
 %22;%0A
-%09
 %09met
@@ -1504,17 +1504,16 @@
 rave%22);%0A
-%09
 %09meta.mo
@@ -1523,17 +1523,16 @@
 =MODID;%0A
-%09
 %09meta.na
@@ -1540,17 +1540,16 @@
 e=NAME;%0A
-%09
 %09meta.ve
@@ -1568,11 +1568,8 @@
 N;%0A%09
-%09//
 meta
@@ -1586,18 +1586,61 @@
 on=%22
-EDM
+Mod that helps fixes the MANY errors in my mods
 %22;%0A%09%09%0A
-%09
 %09MCC
@@ -1710,17 +1710,16 @@
 ase());%0A
-%09
 %09Main.ha
@@ -1838,17 +1838,16 @@
 onDEV);%0A
-%09
 %09MCConfi
@@ -1871,19 +1871,17 @@
 ave();%0A%09
-%09%0A%09
+%0A
 %09if(ObfH
@@ -1911,19 +1911,20 @@
 ==false)
+%0A%09
 %7B%0A
-%09
 %09%09LogHel
@@ -1984,16 +1984,14 @@
 ;%0A%09%09
-%09
 try %7B%0A
-%09
 %09%09%09L
@@ -2052,17 +2052,16 @@
 ing());%0A
-%09
 %09%09%7D catc
@@ -2084,33 +2084,32 @@
 ception e) %7B%0A%09%09%09
-%09
 e.printStackTrac
@@ -2113,17 +2113,16 @@
 race();%0A
-%09
 %09%09%7D catc
@@ -2147,17 +2147,16 @@
 on e) %7B%0A
-%09
 %09%09%09e.pri
@@ -2177,12 +2177,10 @@
 ;%0A%09%09
-%09
 %7D%0A
-%09
 %09%7D%0A 

Update Main.java