From 2db8e30b1d2151fdde5d08a6c06aef55f0c397d2 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Fri, 27 Jan 2017 11:32:28 +0300 Subject: License, readme and stuff --- ihl/recipes/IronWorkbenchRecipe.java | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'ihl/recipes/IronWorkbenchRecipe.java') diff --git a/ihl/recipes/IronWorkbenchRecipe.java b/ihl/recipes/IronWorkbenchRecipe.java index 8ecb8df..f0bd81f 100644 --- a/ihl/recipes/IronWorkbenchRecipe.java +++ b/ihl/recipes/IronWorkbenchRecipe.java @@ -16,11 +16,11 @@ public class IronWorkbenchRecipe { public List materials=new ArrayList(); public List outputs = new ArrayList(); - public IronWorkbenchRecipe(List tools1, List materials1, List output1_1) + public IronWorkbenchRecipe(List tools1, List materials1, List output1_1) { if(tools1!=null) { - Iterator iTools1 = tools1.iterator(); + Iterator iTools1 = tools1.iterator(); while(iTools1.hasNext()) { Object tool = iTools1.next(); @@ -37,13 +37,13 @@ public class IronWorkbenchRecipe { tools.add(new RecipeInputItemStack(stack)); } } - else + else { tools.add((IRecipeInput) tool); } } } - Iterator iMaterials1 = materials1.iterator(); + Iterator iMaterials1 = materials1.iterator(); while(iMaterials1.hasNext()) { Object material = iMaterials1.next(); @@ -77,9 +77,33 @@ public class IronWorkbenchRecipe { } } - public IronWorkbenchRecipe(List asList, List asList2, List asList3, List workspaceElements1) { + public IronWorkbenchRecipe(List asList, List asList2, List asList3, List workspaceElements1) { this(asList, asList2, asList3); + if(workspaceElements1!=null) + { this.workspaceElements.addAll(workspaceElements1); + } + } + + public boolean isTool(ItemStack tool1) + { + if(tools!=null && !tools.isEmpty()) + { + if(tool1==null) + { + return false; + } + Iterator i1 = tools.iterator(); + while(i1.hasNext()) + { + IRecipeInput tool = i1.next(); + if(tool.matches(tool1)) + { + return true; + } + } + } + return false; } public boolean isCanBeCrafted(List tools1, List materials1, List workspaceElements1) -- cgit v1.2.3