diff options
author | Johannes Gäßler <updrn@student.kit.edu> | 2017-08-19 23:46:31 +0200 |
---|---|---|
committer | Johannes Gäßler <updrn@student.kit.edu> | 2017-08-19 23:46:31 +0200 |
commit | c281488927eb4c5352ab6ea11a7e41e68d5d690a (patch) | |
tree | c449b799a2cd8d89fef17cf8e8b08c448cbd300c /src/main/java/gregtech/api/util/GT_Recipe.java | |
parent | a749a8536f08973ca0a3e778b37f3d78059b9ff2 (diff) | |
parent | e8c75a54ee69b1853b413d3aafbb2ffa02128d19 (diff) | |
download | GT5-Unofficial-c281488927eb4c5352ab6ea11a7e41e68d5d690a.tar.gz GT5-Unofficial-c281488927eb4c5352ab6ea11a7e41e68d5d690a.tar.bz2 GT5-Unofficial-c281488927eb4c5352ab6ea11a7e41e68d5d690a.zip |
Merge branch 'unstable' into PyrometallurgyUpdate
Conflicts:
src/main/java/gregtech/GT_Mod.java
src/main/java/gregtech/api/enums/Materials.java
src/main/java/gregtech/common/GT_Proxy.java
src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java
src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_Recipe.java')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Recipe.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index b60b82505d..996a10666b 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -730,23 +730,35 @@ public class GT_Recipe implements Comparable<GT_Recipe> { return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs); } + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + return findRecipe(aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs); + } + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs); } + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + return findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs); + } + + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + return findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot, aInputs); + } /** * finds a Recipe matching the aFluid and ItemStack Inputs. * * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs + * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage * @param aFluids the Fluid Inputs * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. * @param aInputs the Item Inputs * @return the Recipe it has found or null for no matching Recipe */ - public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; @@ -772,7 +784,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) - if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) + if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. @@ -781,11 +793,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> { Collection<GT_Recipe> tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack))); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } @@ -795,7 +807,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { Collection<GT_Recipe> tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } |