From d1d878b6b9a44fa109da4fe9904ae145f4465a06 Mon Sep 17 00:00:00 2001 From: nekosune Date: Tue, 23 Sep 2014 23:50:43 +0100 Subject: [PATCH] Fixed the finicky Timeless Ivy recepies --- .../crafting/recipe/RegenIvyRecipe.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/MODSRC/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java b/MODSRC/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java index 0d96904a6..b0966bf4f 100644 --- a/MODSRC/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java +++ b/MODSRC/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java @@ -27,21 +27,28 @@ public class RegenIvyRecipe implements IRecipe { ItemStack tool = null; boolean foundIvy = false; int materialsFound = 0; + for(int i = 0; i < var1.getSizeInventory(); i++) { + ItemStack stack = var1.getStackInSlot(i); + if (stack != null) { + Item item = stack.getItem(); + if(item.isRepairable()) + tool = stack; + else if(item == ModItems.regenIvy) + foundIvy = true; + + } + } for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); if(stack != null) { - Item item = stack.getItem(); - if(item.isRepairable()) - tool = stack; + Item item = stack.getItem(); - else if(stack.getItem() == ModItems.regenIvy) - foundIvy = true; - - else if(tool != null && tool.getItem().getIsRepairable(tool, stack)) + if(tool != null && tool.getItem().getIsRepairable(tool, stack)) materialsFound++; - else return false; // Found an invalid item, breaking the recipe + else if(stack!=tool && item!=ModItems.regenIvy ) + return false; } }