diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
3 files changed, 89 insertions, 17 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index bc25a32945..3a889fbf36 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -83,15 +83,29 @@ public interface IGregtech_RecipeAdder { * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs) * * @param aInput = ItemStack[] (not null, and respects StackSize) - * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) - * @param aChances = Output Change (can be == 0) + * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) + * @param aChances = Output Chance (can be == 0) * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU needed for heating up (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt); + /** + * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs) + * + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @return true if the Recipe got added, otherwise false. + */ + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, int aDuration, int aEUt); + + public boolean addLFTRRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); public boolean addLFTRRecipe(ItemStack aInput1, FluidStack aInput2, ItemStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt); public boolean addLFTRRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt); 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 diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index d6b2fe0699..c372335155 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -286,6 +286,35 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, new ItemStack[]{null}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0); return true; } + + @Override + public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, final int aChance, int aDuration, final int aEUt) { + if ((aInput == null) || (aOutput == null)) { + Utils.LOG_WARNING("Fail - Input or Output was null."); + return false; + } + + + if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) { + aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount); + } + if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) { + aOutput = Materials.PulsatingIron.getMolten(aOutput.amount); + } + if ((aDuration = GregTech_API.sRecipeFile.get("blastsmelter", aOutput.getFluid().getName(), aDuration)) <= 0) { + Utils.LOG_WARNING("Recipe did not register."); + return false; + } + + for (int das=0;das<aInput.length;das++){ + if (aInput[das] != null) { + Utils.LOG_WARNING("tMaterial["+das+"]: "+aInput[das].getDisplayName()+", Amount: "+aInput[das].stackSize); + } + } + + Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, new ItemStack[]{null}, null, new int[]{aChance}, new FluidStack[]{aInputFluid}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + return true; + } |