package com.hea3ven.buildingbricks.core;

import java.util.Map.Entry;

import net.minecraft.item.ItemStack;

import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

import com.hea3ven.buildingbricks.core.gui.BuildingBricksGuiHandler;
import com.hea3ven.buildingbricks.core.materials.BlockDescription;
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.MaterialBlockType;
import com.hea3ven.buildingbricks.core.materials.MaterialRegistry;
import com.hea3ven.buildingbricks.core.materials.mapping.MaterialIdMapping;

public class ProxyCommonBuildingBricks {

	public void preInit() {
	}

	public void init() {
		NetworkRegistry.INSTANCE.registerGuiHandler(Properties.MODID, new BuildingBricksGuiHandler());
	}

	public void postInit() {
		addTrowelRecipes();

		addMaterialBlocksRecipes();
	}

	private void addTrowelRecipes() {
		ModBuildingBricks.logger.info("Registering trowel's recipes");
		for (Material mat : MaterialRegistry.getAll()) {
			for (BlockDescription blockDesc : mat.getBlockRotation().getAll().values()) {
				ItemStack trowelStack = new ItemStack(ModBuildingBricks.trowel, 1);
				ItemStack bindedTrowelStack = new ItemStack(ModBuildingBricks.trowel, 1,
						MaterialIdMapping.get().getIdForMaterial(mat));
				GameRegistry.addShapelessRecipe(bindedTrowelStack, trowelStack, blockDesc.getStack());
			}
		}
	}

	private void addMaterialBlocksRecipes() {
		ModBuildingBricks.logger.info("Registering materials recipes");
		for (Material mat : MaterialRegistry.getAll()) {
			for (Entry<MaterialBlockType, BlockDescription> entry : mat.getBlockRotation()
					.getAll()
					.entrySet()) {
				entry.getKey().registerRecipes(mat);
			}
		}
	}
}

@@ -219,24 +219,75 @@
 ameRegistry;
+%0Aimport net.minecraftforge.oredict.ShapedOreRecipe;
 %0A%0Aimport com
@@ -903,16 +903,46 @@
 nit() %7B%0A
+%09%09addPortableLadderRecipe();%0A%0A
 %09%09addTro
@@ -986,24 +986,216 @@
 ipes();%0A%09%7D%0A%0A
+%09private void addPortableLadderRecipe() %7B%0A%09%09GameRegistry.addRecipe(%0A%09%09%09%09new ShapedOreRecipe(new ItemStack(ModBuildingBricks.portableLadder), %22x x%22, %22xxx%22, %22x x%22, 'x',%0A%09%09%09%09%09%09%22ingotIron%22));%0A%09%7D%0A%0A
 %09private voi

Add recipe for the portable ladder