From 1dc501a263b1207d40c411643cfc8ec600f71334 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Mon, 15 Sep 2014 13:14:53 -0500 Subject: [PATCH] Fixed a bug with Crafting Calculator choosing the slower calculation for all types of patterns. --- crafting/CraftingTreeProcess.java | 57 +++++++++++++------------------ 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/crafting/CraftingTreeProcess.java b/crafting/CraftingTreeProcess.java index 1ae2c7e8..1de6b5f9 100644 --- a/crafting/CraftingTreeProcess.java +++ b/crafting/CraftingTreeProcess.java @@ -64,26 +64,22 @@ public class CraftingTreeProcess fullsimulation = true; } - for (int x = 0; x < list.length; x++) + for ( IAEItemStack part : details.getCondencedInputs() ) { - IAEItemStack part = list[x]; - if ( part != null ) + ItemStack g = part.getItemStack(); + + boolean isAnInput = false; + for ( IAEItemStack a : details.getCondencedOutputs() ) { - ItemStack g = part.getItemStack(); - - boolean isAnInput = false; - for (IAEItemStack a : is) - { - if ( g != null && a != null && a.equals( g ) ) - isAnInput = true; - } - - if ( isAnInput ) - limitQty = true; - - if ( g.getItem().hasContainerItem( g ) ) - limitQty = containerItems = true; + if ( g != null && a != null && a.equals( g ) ) + isAnInput = true; } + + if ( isAnInput ) + limitQty = true; + + if ( g.getItem().hasContainerItem( g ) ) + limitQty = containerItems = true; } boolean complicated = false; @@ -117,26 +113,19 @@ public class CraftingTreeProcess } else { - IAEItemStack list[] = details.getInputs(); - IAEItemStack[] is = details.getInputs(); - - for (int x = 0; x < list.length; x++) + for ( IAEItemStack part : details.getCondencedInputs() ) { - IAEItemStack part = list[x]; - if ( part != null ) + ItemStack g = part.getItemStack(); + + boolean isAnInput = false; + for (IAEItemStack a : details.getCondencedOutputs()) { - ItemStack g = part.getItemStack(); - - boolean isAnInput = false; - for (IAEItemStack a : is) - { - if ( g != null && a != null && a.equals( g ) ) - isAnInput = true; - } - - if ( isAnInput ) - limitQty = true; + if ( g != null && a != null && a.equals( g ) ) + isAnInput = true; } + + if ( isAnInput ) + limitQty = true; } for (IAEItemStack part : details.getCondencedInputs())