Java Code Examples for thaumcraft.api.ThaumcraftApiHelper#isResearchComplete()

The following examples show how to use thaumcraft.api.ThaumcraftApiHelper#isResearchComplete() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShapedArcaneRecipe.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 6 votes vote down vote up
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
    for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if (checkMatch(inv, x, y, false))
            {
                return true;
            }

            if (mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
Example 2
Source File: ShapedArcaneRecipe.java    From AdvancedMod with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
    for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if (checkMatch(inv, x, y, false))
            {
                return true;
            }

            if (mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
Example 3
Source File: ShapedArcaneRecipe.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
    for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if (checkMatch(inv, x, y, false))
            {
                return true;
            }

            if (mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
Example 4
Source File: ShapedArcaneRecipe.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
    for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if (checkMatch(inv, x, y, false))
            {
                return true;
            }

            if (mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
Example 5
Source File: ShapedArcaneRecipe.java    From GardenCollection with MIT License 6 votes vote down vote up
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
    for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if (checkMatch(inv, x, y, false))
            {
                return true;
            }

            if (mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
Example 6
Source File: PseudoResearchItem.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public boolean isHidden() {
    EntityPlayer p = Minecraft.getMinecraft().thePlayer;
    if(p != null) {
        if(!ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), this.key)) {
            return false;
        }
    }
    return super.isHidden();
}
 
Example 7
Source File: InfusionRecipe.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
/**
    * Used to check if a recipe matches current crafting inventory
    * @param player 
    */
public boolean matches(ArrayList<ItemStack> 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<ItemStack> ii = new ArrayList<ItemStack>();
	for (ItemStack is:input) {
		ii.add(is.copy());
	}
	
	for (ItemStack comp:getComponents()) {
		boolean b=false;
		for (int a=0;a<ii.size();a++) {
			 i2 = ii.get(a).copy();
			if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
				i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
			}
			if (areItemStacksEqual(i2, comp,true)) {
				ii.remove(a);
				b=true;
				break;
			}
		}
		if (!b) return false;
	}
	return ii.size()==0?true:false;
   }
 
Example 8
Source File: Familiar_Old_AugmentInfusion.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
    if(central == null || !(central.getItem() instanceof ItemFamiliar_Old)) return false; //We call it "FamiliarAugment" Recipe for a reason..
    if(getRecipeInput() == null || !(getRecipeInput().getItem() instanceof ItemFamiliar_Old)) return false; //A bit late but still working..

    if ((this.research.length() > 0) && (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))) {
        return false;
    }

    ItemStack centralCopy = central.copy();
    if(!((ItemFamiliar_Old) centralCopy.getItem()).hasUpgrade(centralCopy, getUpgradeToAdd().getNeededPreviousUpgrade())) return false;

    ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
    for (ItemStack is : input) {
        ii.add(is.copy());
    }
    for (ItemStack comp : getComponents()) {
        boolean b = false;
        for (int a = 0; a < ii.size(); a++) {
            centralCopy = ii.get(a).copy();
            if (comp.getItemDamage() == 32767) {
                centralCopy.setItemDamage(32767);
            }
            if (areItemStacksEqual(centralCopy, comp, true)) {
                ii.remove(a);
                b = true;
                break;
            }
        }
        if (!b) {
            return false;
        }
    }
    return ii.size() == 0;
}
 
Example 9
Source File: InfusionRecipe.java    From AdvancedMod with GNU General Public License v3.0 5 votes vote down vote up
/**
    * Used to check if a recipe matches current crafting inventory
    * @param player 
    */
public boolean matches(ArrayList<ItemStack> 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<ItemStack> ii = new ArrayList<ItemStack>();
	for (ItemStack is:input) {
		ii.add(is.copy());
	}
	
	for (ItemStack comp:getComponents()) {
		boolean b=false;
		for (int a=0;a<ii.size();a++) {
			 i2 = ii.get(a).copy();
			if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
				i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
			}
			if (areItemStacksEqual(i2, comp,true)) {
				ii.remove(a);
				b=true;
				break;
			}
		}
		if (!b) return false;
	}
	return ii.size()==0?true:false;
   }
 
Example 10
Source File: InfusionRecipe.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
/**
    * Used to check if a recipe matches current crafting inventory
    * @param player 
    */
public boolean matches(ArrayList<ItemStack> 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<ItemStack> ii = new ArrayList<ItemStack>();
	for (ItemStack is:input) {
		ii.add(is.copy());
	}
	
	for (ItemStack comp:getComponents()) {
		boolean b=false;
		for (int a=0;a<ii.size();a++) {
			 i2 = ii.get(a).copy();
			if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
				i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
			}
			if (areItemStacksEqual(i2, comp,true)) {
				ii.remove(a);
				b=true;
				break;
			}
		}
		if (!b) return false;
	}
	return ii.size()==0?true:false;
   }
 
Example 11
Source File: InfusionEnchantmentRecipe.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 4 votes vote down vote up
/**
     * Used to check if a recipe matches current crafting inventory
     * @param player 
     */
	public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
		if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
    		return false;
    	}
		
		if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) {
			return false;
		}
				
		Map map1 = EnchantmentHelper.getEnchantments(central);
		Iterator iterator = map1.keySet().iterator();
        while (iterator.hasNext())
        {
        	int j1 = ((Integer)iterator.next()).intValue();
            Enchantment ench = Enchantment.enchantmentsList[j1];
            if (j1 == enchantment.effectId &&
            		EnchantmentHelper.getEnchantmentLevel(j1, central)>=ench.getMaxLevel())
            	return false;
            if (enchantment.effectId != ench.effectId && 
            	(!enchantment.canApplyTogether(ench) ||
            	!ench.canApplyTogether(enchantment))) {
            	return false;
            }
        }
		
		ItemStack i2 = null;
		
		ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
		for (ItemStack is:input) {
			ii.add(is.copy());
		}
		
		for (ItemStack comp:components) {
			boolean b=false;
			for (int a=0;a<ii.size();a++) {
				 i2 = ii.get(a).copy();
				if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
					i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
				}
				if (areItemStacksEqual(i2, comp,true)) {
					ii.remove(a);
					b=true;
					break;
				}
			}
			if (!b) return false;
		}
//		System.out.println(ii.size());
		return ii.size()==0?true:false;
    }
 
Example 12
Source File: InfusionEnchantmentRecipe.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
/**
     * Used to check if a recipe matches current crafting inventory
     * @param player 
     */
	public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
		if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
    		return false;
    	}
		
		if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) {
			return false;
		}
				
		Map map1 = EnchantmentHelper.getEnchantments(central);
		Iterator iterator = map1.keySet().iterator();
        while (iterator.hasNext())
        {
        	int j1 = ((Integer)iterator.next()).intValue();
            Enchantment ench = Enchantment.enchantmentsList[j1];
            if (j1 == enchantment.effectId &&
            		EnchantmentHelper.getEnchantmentLevel(j1, central)>=ench.getMaxLevel())
            	return false;
            if (enchantment.effectId != ench.effectId && 
            	(!enchantment.canApplyTogether(ench) ||
            	!ench.canApplyTogether(enchantment))) {
            	return false;
            }
        }
		
		ItemStack i2 = null;
		
		ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
		for (ItemStack is:input) {
			ii.add(is.copy());
		}
		
		for (ItemStack comp:components) {
			boolean b=false;
			for (int a=0;a<ii.size();a++) {
				 i2 = ii.get(a).copy();
				if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
					i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
				}
				if (areItemStacksEqual(i2, comp,true)) {
					ii.remove(a);
					b=true;
					break;
				}
			}
			if (!b) return false;
		}
//		System.out.println(ii.size());
		return ii.size()==0?true:false;
    }
 
Example 13
Source File: InfusionEnchantmentRecipe.java    From GardenCollection with MIT License 4 votes vote down vote up
/**
     * Used to check if a recipe matches current crafting inventory
     * @param player 
     */
	public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
		if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
    		return false;
    	}
		
		if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) {
			return false;
		}
				
		Map map1 = EnchantmentHelper.getEnchantments(central);
		Iterator iterator = map1.keySet().iterator();
        while (iterator.hasNext())
        {
        	int j1 = ((Integer)iterator.next()).intValue();
            Enchantment ench = Enchantment.enchantmentsList[j1];
            if (j1 == enchantment.effectId &&
            		EnchantmentHelper.getEnchantmentLevel(j1, central)>=ench.getMaxLevel())
            	return false;
            if (enchantment.effectId != ench.effectId && 
            	(!enchantment.canApplyTogether(ench) ||
            	!ench.canApplyTogether(enchantment))) {
            	return false;
            }
        }
		
		ItemStack i2 = null;
		
		ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
		for (ItemStack is:input) {
			ii.add(is.copy());
		}
		
		for (ItemStack comp:components) {
			boolean b=false;
			for (int a=0;a<ii.size();a++) {
				 i2 = ii.get(a).copy();
				if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
					i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
				}
				if (areItemStacksEqual(i2, comp,true)) {
					ii.remove(a);
					b=true;
					break;
				}
			}
			if (!b) return false;
		}
//		System.out.println(ii.size());
		return ii.size()==0?true:false;
    }
 
Example 14
Source File: ShapelessArcaneRecipe.java    From GardenCollection with MIT License 4 votes vote down vote up
@Override
public boolean matches(IInventory var1, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	
    ArrayList required = new ArrayList(input);
    
    for (int x = 0; x < 9; x++)
    {
        ItemStack slot = var1.getStackInSlot(x);

        if (slot != null)
        {
            boolean inRecipe = false;
            Iterator req = required.iterator();

            while (req.hasNext())
            {
                boolean match = false;

                Object next = req.next();

                if (next instanceof ItemStack)
                {
                    match = checkItemEquals((ItemStack)next, slot);
                }
                else if (next instanceof ArrayList)
                {
                    for (ItemStack item : (ArrayList<ItemStack>)next)
                    {
                        match = match || checkItemEquals(item, slot);
                    }
                }

                if (match)
                {
                    inRecipe = true;
                    required.remove(next);
                    break;
                }
            }

            if (!inRecipe)
            {
                return false;
            }
        }
    }
    
    return required.isEmpty();
}
 
Example 15
Source File: InfusionEnchantmentRecipe.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
/**
     * Used to check if a recipe matches current crafting inventory
     * @param player 
     */
	public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
		if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
    		return false;
    	}
		
		if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) {
			return false;
		}
				
		Map map1 = EnchantmentHelper.getEnchantments(central);
		Iterator iterator = map1.keySet().iterator();
        while (iterator.hasNext())
        {
        	int j1 = ((Integer)iterator.next()).intValue();
            Enchantment ench = Enchantment.enchantmentsList[j1];
            if (j1 == enchantment.effectId &&
            		EnchantmentHelper.getEnchantmentLevel(j1, central)>=ench.getMaxLevel())
            	return false;
            if (enchantment.effectId != ench.effectId && 
            	(!enchantment.canApplyTogether(ench) ||
            	!ench.canApplyTogether(enchantment))) {
            	return false;
            }
        }
		
		ItemStack i2 = null;
		
		ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
		for (ItemStack is:input) {
			ii.add(is.copy());
		}
		
		for (ItemStack comp:components) {
			boolean b=false;
			for (int a=0;a<ii.size();a++) {
				 i2 = ii.get(a).copy();
				if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
					i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
				}
				if (areItemStacksEqual(i2, comp,true)) {
					ii.remove(a);
					b=true;
					break;
				}
			}
			if (!b) return false;
		}
//		System.out.println(ii.size());
		return ii.size()==0?true:false;
    }
 
Example 16
Source File: ShapelessArcaneRecipe.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean matches(IInventory var1, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	
    ArrayList required = new ArrayList(input);
    
    for (int x = 0; x < 9; x++)
    {
        ItemStack slot = var1.getStackInSlot(x);

        if (slot != null)
        {
            boolean inRecipe = false;
            Iterator req = required.iterator();

            while (req.hasNext())
            {
                boolean match = false;

                Object next = req.next();

                if (next instanceof ItemStack)
                {
                    match = checkItemEquals((ItemStack)next, slot);
                }
                else if (next instanceof ArrayList)
                {
                    for (ItemStack item : (ArrayList<ItemStack>)next)
                    {
                        match = match || checkItemEquals(item, slot);
                    }
                }

                if (match)
                {
                    inRecipe = true;
                    required.remove(next);
                    break;
                }
            }

            if (!inRecipe)
            {
                return false;
            }
        }
    }
    
    return required.isEmpty();
}
 
Example 17
Source File: InfusionEnchantmentRecipe.java    From AdvancedMod with GNU General Public License v3.0 4 votes vote down vote up
/**
     * Used to check if a recipe matches current crafting inventory
     * @param player 
     */
	public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
		if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
    		return false;
    	}
		
		if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) {
			return false;
		}
				
		Map map1 = EnchantmentHelper.getEnchantments(central);
		Iterator iterator = map1.keySet().iterator();
        while (iterator.hasNext())
        {
        	int j1 = ((Integer)iterator.next()).intValue();
            Enchantment ench = Enchantment.enchantmentsList[j1];
            if (j1 == enchantment.effectId &&
            		EnchantmentHelper.getEnchantmentLevel(j1, central)>=ench.getMaxLevel())
            	return false;
            if (enchantment.effectId != ench.effectId && 
            	(!enchantment.canApplyTogether(ench) ||
            	!ench.canApplyTogether(enchantment))) {
            	return false;
            }
        }
		
		ItemStack i2 = null;
		
		ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
		for (ItemStack is:input) {
			ii.add(is.copy());
		}
		
		for (ItemStack comp:components) {
			boolean b=false;
			for (int a=0;a<ii.size();a++) {
				 i2 = ii.get(a).copy();
				if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
					i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
				}
				if (areItemStacksEqual(i2, comp,true)) {
					ii.remove(a);
					b=true;
					break;
				}
			}
			if (!b) return false;
		}
//		System.out.println(ii.size());
		return ii.size()==0?true:false;
    }
 
Example 18
Source File: ShapelessArcaneRecipe.java    From AdvancedMod with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean matches(IInventory var1, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	
    ArrayList required = new ArrayList(input);
    
    for (int x = 0; x < 9; x++)
    {
        ItemStack slot = var1.getStackInSlot(x);

        if (slot != null)
        {
            boolean inRecipe = false;
            Iterator req = required.iterator();

            while (req.hasNext())
            {
                boolean match = false;

                Object next = req.next();

                if (next instanceof ItemStack)
                {
                    match = checkItemEquals((ItemStack)next, slot);
                }
                else if (next instanceof ArrayList)
                {
                    for (ItemStack item : (ArrayList<ItemStack>)next)
                    {
                        match = match || checkItemEquals(item, slot);
                    }
                }

                if (match)
                {
                    inRecipe = true;
                    required.remove(next);
                    break;
                }
            }

            if (!inRecipe)
            {
                return false;
            }
        }
    }
    
    return required.isEmpty();
}
 
Example 19
Source File: ShapelessArcaneRecipe.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean matches(IInventory var1, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	
    ArrayList required = new ArrayList(input);
    
    for (int x = 0; x < 9; x++)
    {
        ItemStack slot = var1.getStackInSlot(x);

        if (slot != null)
        {
            boolean inRecipe = false;
            Iterator req = required.iterator();

            while (req.hasNext())
            {
                boolean match = false;

                Object next = req.next();

                if (next instanceof ItemStack)
                {
                    match = checkItemEquals((ItemStack)next, slot);
                }
                else if (next instanceof ArrayList)
                {
                    for (ItemStack item : (ArrayList<ItemStack>)next)
                    {
                        match = match || checkItemEquals(item, slot);
                    }
                }

                if (match)
                {
                    inRecipe = true;
                    required.remove(next);
                    break;
                }
            }

            if (!inRecipe)
            {
                return false;
            }
        }
    }
    
    return required.isEmpty();
}
 
Example 20
Source File: RecipeStickyJar.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player) {
    return ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), SimpleResearchItem.getFullName("STICKYJAR")) && getJarItem(inv) != null;
}