aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-10-27 04:37:30 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-10-27 04:37:30 +1000
commit3e2a9a9cf154f717696ae391fe8b998a6e3bbd29 (patch)
treeab9178162a23255bd31423694352f4d0e6b7f3de /src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
parent9fa6dce3449e8d339ee8b81544ccf073bc350745 (diff)
downloadGT5-Unofficial-3e2a9a9cf154f717696ae391fe8b998a6e3bbd29.tar.gz
GT5-Unofficial-3e2a9a9cf154f717696ae391fe8b998a6e3bbd29.tar.bz2
GT5-Unofficial-3e2a9a9cf154f717696ae391fe8b998a6e3bbd29.zip
+ Made Recipes and Material init all runnable classes, now items should generate in a proper fashion.
$ Fixed the Alloy Blast Furnace using the wrong recipe map and not outputting fluids. % Separated GT Material and my Material recipe generation for the Blast Alloy Smelter.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java41
1 files changed, 30 insertions, 11 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index 4f847d697f..c0122cbcf5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -7,10 +7,21 @@ import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
import net.minecraft.item.ItemStack;
-public class RecipeGen_DustGeneration {
+public class RecipeGen_DustGeneration implements Runnable{
- public static void generateRecipes(Material material){
- int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16;
+ 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){
+ final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16;
Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
//Ring Recipe
@@ -27,12 +38,12 @@ public class RecipeGen_DustGeneration {
}
- ItemStack normalDust = material.getDust(1);
- ItemStack smallDust = material.getSmallDust(1);
- ItemStack tinyDust = material.getTinyDust(1);
+ final ItemStack normalDust = material.getDust(1);
+ final ItemStack smallDust = material.getSmallDust(1);
+ final ItemStack tinyDust = material.getTinyDust(1);
- ItemStack[] inputStacks = material.getMaterialComposites();
- ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
+ final ItemStack[] inputStacks = material.getMaterialComposites();
+ final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
if (RecipeUtils.recipeBuilder(
tinyDust, tinyDust, tinyDust,
@@ -87,7 +98,7 @@ public class RecipeGen_DustGeneration {
if (inputStacks.length != 0 && inputStacks.length <= 4){
//Log Input items
Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
- long[] inputStackSize = material.vSmallestRatio;
+ final long[] inputStackSize = material.vSmallestRatio;
Utils.LOG_INFO("mixer is stacksizeVar null? "+(inputStackSize != null));
//Is smallest ratio invalid?
if (inputStackSize != null){
@@ -98,10 +109,18 @@ public class RecipeGen_DustGeneration {
}
//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;
+
//Add mixer Recipe
if (GT_Values.RA.addMixerRecipe(
- inputStacks[0], inputStacks[1],
- inputStacks[2], inputStacks[3],
+ input1, input2,
+ input3, input4,
null, null,
outputStacks,
(int) Math.max(material.getMass() * 2L * 1, 1),