package org.pfaa.fabrica.recipe;

import java.util.Map;

import com.google.common.collect.Maps;

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

public class HoodRecipes {
	
	private static Map<ItemStack, FluidStack> recipes = Maps.newIdentityHashMap();
	
	public static void addRecipe(ItemStack input, FluidStack output) {
		FluidStack outputCopy = output.copy();
		ItemStack inputCopy = input.copy();
		outputCopy.amount /= input.stackSize;
		inputCopy.stackSize = 1;
		recipes.put(inputCopy, outputCopy);
	}
	
	public static FluidStack getOutput(ItemStack input) {
		ItemStack inputCopy = input.copy();
		inputCopy.stackSize = 1;
		FluidStack output = recipes.get(inputCopy).copy();
		output.amount *= input.stackSize;
		return output;
	}
}

@@ -90,16 +90,48 @@
 .Maps;%0A%0A
+import net.minecraft.item.Item;%0A
 import n
@@ -263,16 +263,19 @@
 temStack
+Key
 , FluidS
@@ -302,16 +302,8 @@
 .new
-Identity
 Hash
@@ -308,16 +308,541 @@
 shMap();
+%0A%09%0A%09private static class ItemStackKey %7B%0A%09%09private Item item;%0A%09%09private int damage;%0A%09%09public ItemStackKey(ItemStack itemStack) %7B%0A%09%09%09this.item = itemStack.getItem();%0A%09%09%09this.damage = itemStack.getItemDamage();%0A%09%09%7D%0A%09%09public boolean equals(Object other) %7B%0A%09%09%09if (other instanceof ItemStackKey) %7B%0A%09%09%09%09ItemStackKey otherKey = (ItemStackKey)other;%0A%09%09%09%09return otherKey.item == this.item && otherKey.damage == this.damage;%0A%09%09%09%7D%0A%09%09%09return false;%0A%09%09%7D%0A%09%09public int hashCode() %7B%0A%09%09%09return (this.item.hashCode() * 31) + this.damage;%0A%09%09%7D%0A%09%7D
 %0A%09%0A%09publ
@@ -949,46 +949,8 @@
 ();%0A
-%09%09ItemStack inputCopy = input.copy();%0A
 %09%09ou
@@ -991,56 +991,43 @@
 ;%0A%09%09
-inputCopy.stackSize = 1;%0A%09%09recipes.put
+recipes.put(new ItemStackKey
 (input
-Copy
+)
 , ou
@@ -1103,124 +1103,91 @@
 %7B%0A%09%09
-ItemStack inputCopy = input.copy();%0A%09%09inputCopy.stackSize = 1;%0A%09%09FluidStack output = recipes.get(inputCopy).copy();%0A
+FluidStack output = recipes.get(new ItemStackKey(input));%0A%09%09if (output != null) %7B%0A%09
 %09%09ou
@@ -1214,24 +1214,28 @@
 .stackSize;%0A
+%09%09%7D%0A
 %09%09return out

fix hood recipe lookup