package xyz.ibatv.iba_backblocks;

import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import xyz.ibatv.iba_backblocks.Register.RegisterBlocks;
import xyz.ibatv.iba_backblocks.items.ItemCopperIngot;
import xyz.ibatv.iba_backblocks.items.ItemRawCopper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Metadata;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = IBA_BackBlocks.MODID, name = "IBA Back-Blocks", version = IBA_BackBlocks.VERSION)
public class IBA_BackBlocks {

    public static final String MODID = "iba_backblocks";
    public static final String VERSION = "0.1.0";

	
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    	//item / block init and registering
    	//config handling
    	RegisterBlocks.mc18Ore();
    	RegisterBlocks.mc18logs();
        RegisterBlocks.fences();
        RegisterBlocks.newSandStone();
        RegisterBlocks.initSlimeBlock();
    	
    }
    
    @EventHandler
    public void init(FMLInitializationEvent event) {
    	//proxy, tileEntity, entity, gui and packet registering
    	//GameRegistry.addShapelessRecipe(new ItemStack(TestMod.items.itemCopperIngot, 9), new Object[] {new ItemStack(TestMod.blockCopperBlock, 1)});
    	//GameRegistry.addShapelessRecipe(new ItemStack(TestMod.itemRawCopper, 9), new Object[] {new ItemStack(TestMod.blockRawCopper, 1)});

    	
    	
    	//GameRegistry.addRecipe(new ItemStack(TestMod.blockCopperBlock), new Object[] {"CCC","CCC","CCC", 'C', TestMod.itemCopperIngot}); //Copper Block
    	//GameRegistry.addRecipe(new ItemStack(TestMod.blockRawCopper), new Object[] {"CCC","CCC","CCC", 'C', TestMod.itemRawCopper}); //Raw Copper Block
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
    	
    }

    public static void registerBlockHelper(Block s, String name)
    {
        s.setBlockName(name).setBlockTextureName("iba_backblocks:" + name);
        GameRegistry.registerBlock(s, name);
    }
}
