package squeek.veganoption.content.modules;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import squeek.veganoption.ModInfo;
import squeek.veganoption.VeganOption;
import squeek.veganoption.content.ContentHelper;
import squeek.veganoption.content.IContentModule;
import squeek.veganoption.content.Modifiers;
import squeek.veganoption.content.registry.RelationshipRegistry;
import squeek.veganoption.items.ItemFoodContainered;
import cpw.mods.fml.common.registry.GameRegistry;

public class EggReplacers implements IContentModule
{
	public static Item potatoStarch;
	public static Item appleSauce;

	public static final ItemStack potatoCrusher = new ItemStack(Blocks.piston);

	@Override
	public void create()
	{
		appleSauce = new ItemFoodContainered(3, 1f, false)
				.setUnlocalizedName(ModInfo.MODID + ".appleSauce")
				.setCreativeTab(VeganOption.creativeTab)
				.setTextureName(ModInfo.MODID_LOWER + ":apple_sauce")
				.setContainerItem(Items.bowl);
		GameRegistry.registerItem(appleSauce, "appleSauce");

		potatoStarch = new Item()
				.setUnlocalizedName(ModInfo.MODID + ".potatoStarch")
				.setCreativeTab(VeganOption.creativeTab)
				.setTextureName(ModInfo.MODID_LOWER + ":potato_starch");
		GameRegistry.registerItem(potatoStarch, "potatoStarch");
	}

	@Override
	public void oredict()
	{
		OreDictionary.registerOre(ContentHelper.starchOreDict, potatoStarch);
		OreDictionary.registerOre(ContentHelper.eggOreDict, new ItemStack(appleSauce));
		OreDictionary.registerOre(ContentHelper.eggOreDict, new ItemStack(potatoStarch));
	}

	@Override
	public void recipes()
	{
		GameRegistry.addShapelessRecipe(new ItemStack(appleSauce), new ItemStack(Items.apple), new ItemStack(Items.bowl));

		OreDictionary.registerOre(ContentHelper.eggOreDict, new ItemStack(Items.egg));
		Modifiers.recipes.convertInput(new ItemStack(Items.egg), ContentHelper.eggOreDict);

		GameRegistry.addShapelessRecipe(new ItemStack(potatoStarch), potatoCrusher, new ItemStack(Items.potato));
		Modifiers.crafting.addInputsToKeepForOutput(new ItemStack(potatoStarch), potatoCrusher);
	}

	@Override
	public void finish()
	{
		RelationshipRegistry.addRelationship(new ItemStack(potatoStarch), new ItemStack(Items.potato));
		RelationshipRegistry.addRelationship(new ItemStack(potatoStarch), new ItemStack(Blocks.piston));
	}
}

@@ -1438,16 +1438,98 @@
 ct()%0A%09%7B%0A
+%09%09OreDictionary.registerOre(ContentHelper.eggOreDict, new ItemStack(Items.egg));%0A%0A
 %09%09OreDic
@@ -1799,16 +1799,116 @@
 es()%0A%09%7B%0A
+%09%09Modifiers.recipes.convertInputForFoodOutput(new ItemStack(Items.egg), ContentHelper.eggOreDict);%0A%0A
 %09%09GameRe
@@ -2021,176 +2021,8 @@
 );%0A%0A
-%09%09OreDictionary.registerOre(ContentHelper.eggOreDict, new ItemStack(Items.egg));%0A%09%09Modifiers.recipes.convertInput(new ItemStack(Items.egg), ContentHelper.eggOreDict);%0A%0A
 %09%09Ga

Only convert food outputs to the egg oredict