diff options
author | draknyte1 <draknyte1@hotmail.com> | 2017-02-27 23:15:39 +1000 |
---|---|---|
committer | draknyte1 <draknyte1@hotmail.com> | 2017-02-27 23:15:39 +1000 |
commit | ed6f2e50902a72e55b452e0e3fb9cd72b427d157 (patch) | |
tree | 21c2821f0a4bbe742393d7ea20461e7ac8ac12c8 /src/Java/gtPlusPlus/xmod | |
parent | 4a861cbe2336d6f306499ff782bc852f6ecaa3a5 (diff) | |
download | GT5-Unofficial-ed6f2e50902a72e55b452e0e3fb9cd72b427d157.tar.gz GT5-Unofficial-ed6f2e50902a72e55b452e0e3fb9cd72b427d157.tar.bz2 GT5-Unofficial-ed6f2e50902a72e55b452e0e3fb9cd72b427d157.zip |
+ Added fluids to mixer recipes, instead of consuming cells.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index d3525cedb3..4a2f91647e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -2,25 +2,28 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; -import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.*; +import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; public class RecipeGen_DustGeneration implements Runnable{ final Material toGenerate; - + public RecipeGen_DustGeneration(final Material M){ this.toGenerate = M; } - + @Override public void run() { generateRecipes(toGenerate); } - + public static void generateRecipes(final Material material){ generateRecipes(material, false); } @@ -99,13 +102,13 @@ public class RecipeGen_DustGeneration implements Runnable{ //Macerate blocks back to dusts. ItemStack materialBlock = material.getBlock(1); ItemStack materialFrameBox = material.getFrameBox(1); - + if (materialBlock != null) - GT_ModHandler.addPulverisationRecipe(materialBlock, material.getDust(9)); + GT_ModHandler.addPulverisationRecipe(materialBlock, material.getDust(9)); if (materialFrameBox != null) - GT_ModHandler.addPulverisationRecipe(materialFrameBox, material.getDust(2)); - + GT_ModHandler.addPulverisationRecipe(materialFrameBox, material.getDust(2)); + //Is this a composite? if (inputStacks != null && !disableOptional){ //Is this a composite? @@ -119,24 +122,45 @@ public class RecipeGen_DustGeneration implements Runnable{ if (inputStackSize != null){ //set stack sizes on an input ItemStack[] for (short x=0;x<inputStacks.length;x++){ - if (inputStacks[x] != null && inputStackSize[x] != 0) - inputStacks[x].stackSize = (int) inputStackSize[x]; + if (inputStacks[x] != null && inputStackSize[x] != 0){ + inputStacks[x].stackSize = (int) inputStackSize[x]; + } } //Relog input values, with stack sizes Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); - + //Get us four ItemStacks to input into the mixer ItemStack input1, input2, input3, input4; - input1 = (inputStacks.length >= 1) ? (input1 = (inputStacks[0] == null) ? null : inputStacks[0]) : null; - input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null; - input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null; - input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null; - + input1 = (inputStacks.length >= 1) ? (input1 = (inputStacks[0] == null) ? null : inputStacks[0]) : null; + input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null; + input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null; + input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null; + //Add mixer Recipe + + FluidStack oxygen = GT_Values.NF; + if (material.getComposites() != null){ + for (MaterialStack x : material.getComposites()){ + if (!material.getComposites().isEmpty()){ + if (x != null){ + if (x.getStackMaterial() != null){ + if (x.getStackMaterial().getDust(1) == null){ + if (x.getStackMaterial().getState() == MaterialState.GAS){ + oxygen = x.getStackMaterial().getFluid(1000); + } + } + } + } + } + } + + } + if (GT_Values.RA.addMixerRecipe( input1, input2, input3, input4, - null, null, + oxygen, + null, outputStacks, (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) @@ -149,11 +173,11 @@ public class RecipeGen_DustGeneration implements Runnable{ } } } - - - - - + + + + + } } |