diff options
-rw-r--r-- | src/Java/gtPlusPlus/core/material/MaterialStack.java | 6 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java | 68 |
2 files changed, 49 insertions, 25 deletions
diff --git a/src/Java/gtPlusPlus/core/material/MaterialStack.java b/src/Java/gtPlusPlus/core/material/MaterialStack.java index 6221d5905f..710a9b645a 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialStack.java +++ b/src/Java/gtPlusPlus/core/material/MaterialStack.java @@ -35,10 +35,10 @@ public class MaterialStack { public ItemStack getValidStack(){ if (this.stackMaterial.getDust(1) == null){ - if (this.stackMaterial.getCell(1) == null){ + //if (this.stackMaterial.getCell(1) == null){ return null; - } - return this.stackMaterial.getCell(this.vAmount[0]); + //} + //return this.stackMaterial.getCell(this.vAmount[0]); } return this.stackMaterial.getDust(this.vAmount[0]); } 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{ } } } - - - - - + + + + + } } |