package thaumcraft.api.crafting; import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.AspectList; public class InfusionRecipe { protected AspectList aspects; protected String research; private ItemStack[] components; private ItemStack recipeInput; protected Object recipeOutput; protected int instability; public InfusionRecipe(String research, Object output, int inst, AspectList aspects2, ItemStack input, ItemStack[] recipe) { this.research = research; this.recipeOutput = output; this.recipeInput = input; this.aspects = aspects2; this.components = recipe; this.instability = inst; } /** * Used to check if a recipe matches current crafting inventory * @param player */ public boolean matches(ArrayList input, ItemStack central, World world, EntityPlayer player) { if (getRecipeInput()==null) return false; if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { return false; } ItemStack i2 = central.copy(); if (getRecipeInput().getItemDamage()==OreDictionary.WILDCARD_VALUE) { i2.setItemDamage(OreDictionary.WILDCARD_VALUE); } if (!areItemStacksEqual(i2, getRecipeInput(), true)) return false; ArrayList ii = new ArrayList(); for (ItemStack is:input) { ii.add(is.copy()); } for (ItemStack comp:getComponents()) { boolean b=false; for (int a=0;a