diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-09-26 18:40:32 +1000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-09-26 18:40:32 +1000 |
commit | 1435e8a664d28389a0220b6fdfb1d3e7980a7f4e (patch) | |
tree | 1cb593ffcc24248fcabcc6c24e5a6991929fac19 /src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java | |
parent | 2f61b44487964411c9a02dcce70e39bae388805e (diff) | |
download | GT5-Unofficial-1435e8a664d28389a0220b6fdfb1d3e7980a7f4e.tar.gz GT5-Unofficial-1435e8a664d28389a0220b6fdfb1d3e7980a7f4e.tar.bz2 GT5-Unofficial-1435e8a664d28389a0220b6fdfb1d3e7980a7f4e.zip |
% Changed Blast Smelter Recipe addition again. Input fluids should now be supported.
> This allows more alloys requiring oxygen or argon to be produced.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java index 31823932ee..2cf667da4f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java @@ -15,6 +15,7 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { private final OrePrefixes[] mSmeltingPrefixes = { OrePrefixes.crushed, + OrePrefixes.ingot, OrePrefixes.crushedPurified, OrePrefixes.crushedCentrifuged, OrePrefixes.dust, @@ -23,7 +24,7 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { OrePrefixes.dustRefined, OrePrefixes.dustSmall, OrePrefixes.dustTiny - }; + }; public RecipeGen_BlastSmelterGT_Ex() { for (OrePrefixes tPrefix : this.mSmeltingPrefixes) tPrefix.add(this); @@ -41,6 +42,11 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { } } } + case ingot: + if (aMaterial.mBlastFurnaceRequired) { + addBlastRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), 1L) : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, aMaterial); + } + break; case dustSmall: if (aMaterial.mBlastFurnaceRequired) { addBlastRecipe(GT_Utility.copyAmount(4L, new Object[]{aStack}), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), 1L) : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, aMaterial); @@ -65,15 +71,15 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { break; } } - + public boolean addBlastRecipe(ItemStack input1, ItemStack input2, FluidStack fluid1, FluidStack fluid2, ItemStack output1, ItemStack output2, int time, int euCost, Materials smeltInto) { - + //Set up variables. ItemStack[] components; int count = 0; - + if (smeltInto == Materials._NULL){ //If the material is null then we probably don't want to try. return false; @@ -88,24 +94,47 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { else if (input1 == null || input2 == null){ count = 1; } - if (fluid1 != null || fluid2 != null){ - //If it uses an input fluid, we cannot handle this. So let's not try. (Annealed copper for example) - return false; - } - //Set up input components. ItemStack configCircuit = ItemUtils.getGregtechCircuit(count); components = new ItemStack[]{configCircuit, input1, input2}; - + if (fluid1 != null || fluid2 != null){ + //If it uses an input fluid, we cannot handle this. So let's not try. (Annealed copper for example) + //return false; + if (fluid1 != null && fluid2 != null){ + //Cannot handle two input fluids + return false; + } + FluidStack mInputfluidstack; + if (fluid1 != null && fluid2 == null){ + mInputfluidstack = fluid1; + } + else if (fluid1 == null && fluid2 != null){ + mInputfluidstack = fluid2; + } + else { + mInputfluidstack = null; + } + + //Try with new handler + //Add Blast Smelter Recipe. + return CORE.RA.addBlastSmelterRecipe( + components, + mInputfluidstack, + smeltInto.mSmeltInto.getMolten(144L), + 100, + MathUtils.roundToClosestInt(time*0.8), + euCost); // EU Cost + + } + //Add Blast Smelter Recipe. - CORE.RA.addBlastSmelterRecipe( + return CORE.RA.addBlastSmelterRecipe( components, smeltInto.mSmeltInto.getMolten(144L), 100, MathUtils.roundToClosestInt(time*0.8), euCost); // EU Cost - - return false; + } - + }
\ No newline at end of file |