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;
	}
}

package org.pfaa.fabrica.recipe;

import java.util.Map;

import com.google.common.collect.Maps;

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

public class HoodRecipes {
	
	private static Map<ItemStackKey, FluidStack> recipes = Maps.newHashMap();
	
	private static class ItemStackKey {
		private Item item;
		private int damage;
		public ItemStackKey(ItemStack itemStack) {
			this.item = itemStack.getItem();
			this.damage = itemStack.getItemDamage();
		}
		public boolean equals(Object other) {
			if (other instanceof ItemStackKey) {
				ItemStackKey otherKey = (ItemStackKey)other;
				return otherKey.item == this.item && otherKey.damage == this.damage;
			}
			return false;
		}
		public int hashCode() {
			return (this.item.hashCode() * 31) + this.damage;
		}
	}
	
	public static void addRecipe(ItemStack input, FluidStack output) {
		FluidStack outputCopy = output.copy();
		outputCopy.amount /= input.stackSize;
		recipes.put(new ItemStackKey(input), outputCopy);
	}
	
	public static FluidStack getOutput(ItemStack input) {
		FluidStack output = recipes.get(new ItemStackKey(input));
		if (output != null) {
			output.amount *= input.stackSize;
		}
		return output;
	}
}

fix hood recipe lookup