package xyz.ibatv.iba_backblocks.Register;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import xyz.ibatv.iba_backblocks.*;
import xyz.ibatv.iba_backblocks.blocks.mc18.BlockRedSandstone;
import xyz.ibatv.iba_backblocks.blocks.mc18.BlockSlime;
import xyz.ibatv.iba_backblocks.blocks.mc18.fence.cherryWoodFence;
import xyz.ibatv.iba_backblocks.blocks.mc18.fence.spruceWoodFence;
import xyz.ibatv.iba_backblocks.blocks.mc18.logs.*;
import xyz.ibatv.iba_backblocks.init.InitBlocks;


public class RegisterBlocks {


	public static void mc18Ore() {
		GameRegistry.registerBlock(InitBlocks.oreCopper, "copper_ore").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.copperBlock, "copper_block").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.Andesite, "andesite").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.Diorite, "diorite").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.Granite, "granite").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.Prismarine, "prismarine").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.prismarine_bricks, "prismarine_bricks").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.dark_prismarine, "dark_prismarine").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.sea_lantern, "sea_lantern").setCreativeTab(CreativeTabs.tabBlock).setLightLevel(1.0F);
		GameRegistry.registerBlock(InitBlocks.coarse_dirt, "coarse_dirt").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.red_sandstone, "red_sandstone").setCreativeTab(CreativeTabs.tabBlock);

		GameRegistry.registerBlock(InitBlocks.cherry_planks, "cherry_planks").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.spruce_planks, "spruce_planks").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.cherry_planks, "cherry_planks").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.cherry_planks, "cherry_planks").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.cherry_planks, "cherry_planks").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.cherry_planks, "cherry_planks").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.cherry_planks, "cherry_planks").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.cherry_planks, "cherry_planks").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.raw_copper_block, "raw_copper_block").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.polished_andesite, "polished_andesite").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.polished_diorite, "polished_diorite").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.polished_granite, "polished_granite").setCreativeTab(CreativeTabs.tabBlock);
		GameRegistry.registerBlock(InitBlocks.wet_sponge, "wet_sponge").setCreativeTab(CreativeTabs.tabBlock);
		//GameRegistry.registerBlock(InitBlocks.slime_block, "slime_block").setCreativeTab(CreativeTabs.tabBlock);


	}


	public static Block blockStrippedOldLog;
	public static Block blockStrippedNewLog;
	public static Block blockStrippedNewLog2;
	public static Block blockNewNewLog;
	public static Block blockNewNewLog2;

	public static void mc18logs() {
		// NEW LOGS AND STRIPPED LOGS
		blockStrippedOldLog = new BlockStrippedOldLog().setBlockName("stripped").setBlockTextureName("stripped").setCreativeTab(CreativeTabs.tabBlock);
		blockStrippedNewLog = new BlockStrippedNewLog().setBlockName("stripped2").setBlockTextureName("stripped").setCreativeTab(CreativeTabs.tabBlock);
		blockStrippedNewLog2 = new BlockStrippedNewLog2().setBlockName("stripped3").setBlockTextureName("stripped").setCreativeTab(CreativeTabs.tabBlock);
		blockNewNewLog = new BlockNewNewLog().setBlockName("log2").setBlockTextureName("log").setCreativeTab(CreativeTabs.tabBlock);
		blockNewNewLog2 = new BlockNewNewLog2().setBlockName("log3").setBlockTextureName("log").setCreativeTab(CreativeTabs.tabBlock);

		GameRegistry.registerBlock(blockStrippedOldLog, ItemStrippedOldLogs.class, blockStrippedOldLog.getUnlocalizedName().substring(5));
		GameRegistry.registerBlock(blockStrippedNewLog, ItemStrippedNewLogs.class, blockStrippedNewLog.getUnlocalizedName().substring(5));
		GameRegistry.registerBlock(blockStrippedNewLog2, ItemStrippedNewLogs2.class, blockStrippedNewLog2.getUnlocalizedName().substring(5));
		GameRegistry.registerBlock(blockNewNewLog, ItemNewNewLogs.class, blockNewNewLog.getUnlocalizedName().substring(5));
		GameRegistry.registerBlock(blockNewNewLog2, ItemNewNewLogs2.class, blockNewNewLog2.getUnlocalizedName().substring(5));
	}


	public static Block cherryWoodFence;
	public static Block spruceWoodFence;

	public static void fences() {
		cherryWoodFence = new cherryWoodFence(Material.wood)
				.setHardness(5F).setResistance(7F).setStepSound(Block.soundTypeWood);
		GameRegistry.registerBlock(cherryWoodFence, "cherryWoodFence");

		spruceWoodFence = new spruceWoodFence(Material.wood)
				.setHardness(5F).setResistance(7F).setStepSound(Block.soundTypeWood);
		GameRegistry.registerBlock(spruceWoodFence, "spruceWoodFence");
	}


	public static BlockRedSandstone red_sandstone;

	public static void newSandStone() {
		red_sandstone = new BlockRedSandstone();
		red_sandstone.setStepSound(Block.soundTypePiston).setHardness(0.8F);

		IBA_BackBlocks.registerBlockHelper(red_sandstone, "red_sandstone");


		BlockRedSandstone red_sandstone_smooth = new BlockRedSandstone();
		red_sandstone_smooth.setStepSound(Block.soundTypePiston).setHardness(0.8F);
		IBA_BackBlocks.registerBlockHelper(red_sandstone_smooth, "red_sandstone_smooth");


		BlockRedSandstone red_sandstone_carved = new BlockRedSandstone();
		red_sandstone_carved.setStepSound(Block.soundTypePiston).setHardness(0.8F);

		IBA_BackBlocks.registerBlockHelper(red_sandstone_carved, "red_sandstone_carved");
	}

	public static void initSlimeBlock()
	{
		BlockSlime slime = new BlockSlime();

		IBA_BackBlocks.registerBlockHelper(slime, "slime_block");

		GameRegistry.addRecipe(new ItemStack(slime), "ppp", "ppp",	"ppp",
				'p', Items.slime_ball);

		GameRegistry.addShapelessRecipe(new ItemStack(Items.slime_ball, 9), slime);
	}

}