diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java | 102 |
1 files changed, 52 insertions, 50 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index c84989e950..efc5c10551 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.ArrayList; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gtPlusPlus.core.lib.CORE; @@ -8,39 +10,36 @@ import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; - -import java.util.ArrayList; - import net.minecraft.item.ItemStack; public class RecipeGen_BlastSmelter implements Runnable{ final Material toGenerate; - + public RecipeGen_BlastSmelter(final Material M){ this.toGenerate = M; } - + @Override public void run() { - generateARecipe(toGenerate); + generateARecipe(this.toGenerate); } public static void generateARecipe(final Material M){ - //Add a Blast Smelting Recipe, Let's go! + //Add a Blast Smelting Recipe, Let's go! ItemStack tStack; if (null != (tStack = M.getDust(1))) { - - Material[] badMaterials = { - FLUORIDES.THORIUM_HEXAFLUORIDE, - FLUORIDES.THORIUM_TETRAFLUORIDE, - ALLOY.BLOODSTEEL, - //ALLOY.BEDROCKIUM, - NUCLIDE.LiFBeF2ThF4UF4, - NUCLIDE.LiFBeF2ZrF4U235 + + final Material[] badMaterials = { + FLUORIDES.THORIUM_HEXAFLUORIDE, + FLUORIDES.THORIUM_TETRAFLUORIDE, + ALLOY.BLOODSTEEL, + //ALLOY.BEDROCKIUM, + NUCLIDE.LiFBeF2ThF4UF4, + NUCLIDE.LiFBeF2ZrF4U235 }; - for (Material R : badMaterials){ + for (final Material R : badMaterials){ if (M == R){ return; } @@ -48,12 +47,12 @@ public class RecipeGen_BlastSmelter implements Runnable{ //Prepare some Variables ItemStack[] components; - ArrayList<MaterialStack> tMaterial = new ArrayList<MaterialStack>(); + ArrayList<MaterialStack> tMaterial = new ArrayList<>(); short counter=0; int inputStackCount=0; int fluidAmount=0; - boolean doTest = true; - tMaterial = M.getComposites(); + final boolean doTest = true; + tMaterial = M.getComposites(); //This Bad boy here is what dictates unique recipes. Fuck life, right? ItemStack circuitGT = ItemUtils.getGregtechCircuit(0); @@ -65,36 +64,38 @@ public class RecipeGen_BlastSmelter implements Runnable{ duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK(); } else { - duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; + duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; } int mMaterialListSize=0; if (M.getComposites() != null){ - for (gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()){ - if (ternkfsdf != null) - mMaterialListSize++; + for (final gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()){ + if (ternkfsdf != null) { + mMaterialListSize++; + } } } else { - mMaterialListSize = 1; - } + mMaterialListSize = 1; + } Utils.LOG_WARNING("Size: "+mMaterialListSize); - //Make a simple one Material Materialstack[] and log it for validity. + //Make a simple one Material Materialstack[] and log it for validity. circuitGT = ItemUtils.getGregtechCircuit(1); - ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, tStack}; + final ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, tStack}; inputStackCount = 1; fluidAmount = 144*inputStackCount; Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal."); for (int das=0;das<tItemStackTest.length;das++){ - if (tItemStackTest[das] != null) + if (tItemStackTest[das] != null) { Utils.LOG_WARNING("tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize); + } } - - boolean hasMoreInputThanACircuit = (tItemStackTest.length > 1); + + final boolean hasMoreInputThanACircuit = (tItemStackTest.length > 1); //Generate Recipes for all singular materials that can be made molten. if (hasMoreInputThanACircuit){ @@ -130,12 +131,12 @@ public class RecipeGen_BlastSmelter implements Runnable{ if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration/2, 60)){ Utils.LOG_WARNING("Success, Also added a Fluid Extractor recipe."); } - ItemStack tempitem = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1); + final ItemStack tempitem = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1); if (tempitem != null){ if (GT_Values.RA.addFluidExtractionRecipe(tempitem, null, M.getFluid(16), 100, duration/2/9, 60)){ Utils.LOG_WARNING("Success, Also added a Fluid Extractor recipe."); } - } + } if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){ Utils.LOG_WARNING("Success, Also added a Fluid Extractor recipe."); } @@ -143,11 +144,11 @@ public class RecipeGen_BlastSmelter implements Runnable{ Utils.LOG_WARNING("Success, Also added a Fluid Extractor recipe."); } } - } + } else { Utils.LOG_WARNING("Failed."); - } - } + } + } if (tMaterial != null){ //Reset the Variables for compounds if last recipe was a success. @@ -158,21 +159,21 @@ public class RecipeGen_BlastSmelter implements Runnable{ //If this Material has some kind of compound list, proceed if (mMaterialListSize > 1){ - gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; + final gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize); //Just double checking if (tempStack.length > 1){ //Builds me a MaterialStack[] from the MaterialList of M. int ooo=0; - for (gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()){ + for (final gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()){ if (xMaterial != null){ if (xMaterial.getStackMaterial() != null){ Utils.LOG_WARNING("FOUND: "+xMaterial.getStackMaterial().getLocalizedName()); - Utils.LOG_WARNING("ADDING: "+xMaterial.getStackMaterial().getLocalizedName()); - } - tempStack[ooo] = xMaterial; - } + Utils.LOG_WARNING("ADDING: "+xMaterial.getStackMaterial().getLocalizedName()); + } + tempStack[ooo] = xMaterial; + } ooo++; } @@ -181,25 +182,25 @@ public class RecipeGen_BlastSmelter implements Runnable{ inputStackCount=0; for (int irc=0;irc<M.getComposites().size();irc++){ if (M.getComposites().get(irc) != null){ - int r = (int) M.vSmallestRatio[irc]; + final int r = (int) M.vSmallestRatio[irc]; inputStackCount = inputStackCount+r; components[irc] = M.getComposites().get(irc).getDustStack(r); - } + } } //Adds a circuit - if (mMaterialListSize < 9 && mMaterialListSize != 0){ - ItemStack[] components_NoCircuit = components; + if ((mMaterialListSize < 9) && (mMaterialListSize != 0)){ + final ItemStack[] components_NoCircuit = components; //Builds me an ItemStack[] of the materials. - With a circuit components = new ItemStack[components_NoCircuit.length+1]; - for (int fr=0;fr<components.length;fr++){ + for (int fr=0;fr<components.length;fr++){ if (fr==0){ components[0] = circuitGT; } else { components[fr] = components_NoCircuit[fr-1]; - } + } } Utils.LOG_WARNING("Should have added a circuit. mMaterialListSize: "+mMaterialListSize+" | circuit: "+components[0].getDisplayName()); } @@ -213,8 +214,9 @@ public class RecipeGen_BlastSmelter implements Runnable{ Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal."); Utils.LOG_WARNING("tMaterial.length: "+components.length+"."); for (int das=0;das<components.length;das++){ - if (components[das] != null) + if (components[das] != null) { Utils.LOG_WARNING("tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize); + } } //Adds Recipe @@ -229,10 +231,10 @@ public class RecipeGen_BlastSmelter implements Runnable{ else { if (CORE.RA.addBlastSmelterRecipe(components, M.getFluid(fluidAmount), 100, duration, 240)){ Utils.LOG_WARNING("Success."); - } + } else { Utils.LOG_WARNING("Failed."); - } + } } } } |