package org.pfaa.chemica.registration;

import java.util.List;

import org.pfaa.chemica.item.MaterialStack;
import org.pfaa.fabrica.registration.MaterialStackList;

import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;

public class MaterialRecipeRegistryProxy implements MaterialRecipeRegistry {

	private RecipeRegistry delegate;
	
	public MaterialRecipeRegistryProxy(RecipeRegistry delegate) {
		this.delegate = delegate;
	}

	@Override
	public void registerCastingRecipe(ItemStack input, ItemStack output, MaterialStack flux, int temp) {
		for (ItemStack itemStack : flux.getItemStacks()) {
			delegate.registerCastingRecipe(input, output, itemStack, temp);
		}
	}

	@Override
	public void registerRoastingRecipe(MaterialStackList inputs, ItemStack output, int temp) {
		for (List<ItemStack> itemStacks : inputs.getItemStackLists()) {
			delegate.registerRoastingRecipe(itemStacks, output, temp);
		}
	}

	@Override
	public void registerAbsorptionRecipe(MaterialStackList inputs, FluidStack additive, ItemStack output, int temp) {
		for (List<ItemStack> itemStacks : inputs.getItemStackLists()) {
			delegate.registerAbsorptionRecipe(itemStacks, additive, output, temp);
		}
	}

	@Override
	public void registerMixingRecipe(FluidStack input, MaterialStackList additives, FluidStack output, int temp) {
		for (List<ItemStack> itemStacks : additives.getItemStackLists()) {
			delegate.registerMixingRecipe(input, itemStacks, output, temp);
		}
	}

	@Override
	public void registerMixingRecipe(MaterialStackList inputs, ItemStack output) {
		// TODO Auto-generated method stub

	}

}

@@ -121,46 +121,72 @@
 faa.
-fabrica.registration.Material
+chemica.model.Strength;%0Aimport org.pfaa.chemica.util.Chance
 Stack
-List
 ;%0A%0Ai
@@ -1594,43 +1594,410 @@
 %7B%0A%09%09
-// TODO Auto-generated method stub%0A
+for (List%3CItemStack%3E itemStacks : inputs.getItemStackLists()) %7B%0A%09%09%09delegate.registerMixingRecipe(itemStacks, output);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public void registerGrindingRecipe(MaterialStack input, ItemStack output, List%3CChanceStack%3E secondaries,%0A%09%09%09Strength strength) %7B%0A%09%09for (ItemStack itemStack : input.getItemStacks()) %7B%0A%09%09%09delegate.registerGrindingRecipe(itemStack, output, secondaries, strength);%0A%09%09%7D
 %0A%09%7D%0A

implement grinding in material registry