diff options
-rw-r--r-- | dependencies.gradle | 2 | ||||
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java | 28 |
2 files changed, 10 insertions, 20 deletions
diff --git a/dependencies.gradle b/dependencies.gradle index 32de581696..e507d3bfe6 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,6 +1,6 @@ dependencies { compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.00:dev') - compile('com.github.GTNewHorizons:StructureLib:1.1.3:dev') + compile('com.github.GTNewHorizons:StructureLib:1.1.5:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.2.20-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenCore:1.1.4:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 0e5027fc09..f6d4d3946c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -475,9 +475,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En } } - // Count the slots we need, later we can check if any are able to merge with existing stacks - int aRecipeSlotsRequired = 0; - // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the recipe outputs. ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap = new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>(); @@ -489,24 +486,17 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En } else { int aStackSize = aY.stackSize * aParallelRecipes; - if (aStackSize > 64) { - int aSlotsNeedsForThisStack = (int) Math.ceil((double) ((float) aStackSize / 64f)); - // Should round up and add as many stacks as required nicely. - aRecipeSlotsRequired += aSlotsNeedsForThisStack; - for (int o=0;o<aRecipeSlotsRequired;o++) { - int aStackToRemove = (aStackSize -= 64) > 64 ? 64 : aStackSize; - aY = aY.copy(); - aY.stackSize = 0; - aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove)); - } - } - else { - // Only requires one slot - aRecipeSlotsRequired++; + + int aSlotsNeedsForThisStack = (int) Math.ceil((float) aStackSize / aY.getMaxStackSize()); + // Should round up and add as many stacks as required nicely. + for (int o=0;o<aSlotsNeedsForThisStack;o++) { + if (aStackSize < 1) break; + int aStackToRemove = Math.min(aStackSize, aY.getMaxStackSize()); + aStackSize -= aStackToRemove; aY = aY.copy(); aY.stackSize = 0; - aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackSize)); - } + aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove)); + } } } |