From 7dae561b891dd5418f5511e4a0f3e1b69d0f7fcd Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 21 Jun 2015 12:02:29 -0400 Subject: [PATCH] Allow copying of any amount of filters --- .../conduit/item/filter/CopyFilterRecipe.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/crazypants/enderio/conduit/item/filter/CopyFilterRecipe.java b/src/main/java/crazypants/enderio/conduit/item/filter/CopyFilterRecipe.java index 8e3f7d5b..d3d36c74 100644 --- a/src/main/java/crazypants/enderio/conduit/item/filter/CopyFilterRecipe.java +++ b/src/main/java/crazypants/enderio/conduit/item/filter/CopyFilterRecipe.java @@ -19,30 +19,30 @@ public class CopyFilterRecipe implements IRecipe{ @Override public boolean matches(InventoryCrafting inv, World world) { - ItemStack blankInput = null; + int blankCount = 0; ItemStack filterInput = null; for (int i = 0; i < inv.getSizeInventory(); i++) { ItemStack checkStack = inv.getStackInSlot(i); if (checkStack != null && checkStack.getItem() instanceof IItemFilterUpgrade) { if(FilterRegister.isFilterSet(checkStack)) { - if(filterInput != null || !isSameTypeOrNull(blankInput, checkStack)) { - return false; - } - filterInput = checkStack; - } else { - if(blankInput != null || !isSameTypeOrNull(filterInput, checkStack)) { + if(filterInput != null) { return false; } - blankInput = checkStack; + filterInput = checkStack; + } else { + if(!isSameTypeOrNull(filterInput, checkStack)) { + return false; + } + blankCount++; } } } - if(blankInput == null || filterInput == null) { + if(blankCount == 0 || filterInput == null) { return false; } output = filterInput.copy(); - output.stackSize = 2; + output.stackSize = blankCount + 1; return true; }