diff options
9 files changed, 242 insertions, 23 deletions
diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index 082dc6e264..1b9c4c841e 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -8,6 +8,8 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map_Assembler; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -277,6 +279,10 @@ public class Recipe_GT extends GT_Recipe{ " EU", true, false); + //Component Assembler + public static final GT_Recipe_Map sComponentAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet<GT_Recipe>(300), "gt.recipe.componentassembler", "Component Assembler", null, RES_PATH_GUI + "basicmachines/Assembler", 6, 1, 1, 0, 1, E, 1, E, true, true); + + /** * HashMap of Recipes based on their Items */ diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index eecbcec9e9..a59fc7923b 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -100,6 +100,7 @@ public class COMPAT_HANDLER { GregtechIndustrialGeneratorArray.run(); GregtechIndustrialCuttingFactory.run(); GregtechMiniRaFusion.run(); + GregtechComponentAssembler.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java index 1f65d0b1b2..13fc4f02dd 100644 --- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java @@ -673,6 +673,10 @@ public class ItemUtils { //If only Tinkers dust exists, bow down and just use it. return getItemStackOfAmountFromOreDictNoBroken(oredictName, amount); } + public static ItemStack getGregtechOreStack(OrePrefixes mPrefix, Materials mMat, int mAmount) { + ItemStack gregstack = ItemUtils.getItemStackOfAmountFromOreDict(mPrefix.name().toLowerCase()+mMat.mDefaultLocalName, mAmount); + return (gregstack != null ? gregstack : null); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 1cb5c4c45a..e77be6dab6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -29,11 +29,7 @@ public class HANDLER_GT { if (mMaterialProperties != null){ GT_Materials.init(mMaterialProperties); } - GregtechFluidHandler.run(); - - if (CORE.configSwitches.enableNitroFix){ - GregtechNitroDieselFix.run(); - } + GregtechFluidHandler.run(); } @@ -61,6 +57,9 @@ public class HANDLER_GT { } public static void postInit(){ + if (CORE.configSwitches.enableNitroFix){ + GregtechNitroDieselFix.run(); + } //Register some custom recipe maps for any enabled multiblocks. //MultiblockRecipeMapHandler.run(); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 7a0df6c43c..fd548a208b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -269,7 +269,11 @@ public enum GregtechItemList implements GregtechItemContainer { Industrial_CuttingFactoryController, //Tiny Fusion - Miniature_Fusion, + Miniature_Fusion, + + //Component Makers + Machine_LV_Component_Maker, Machine_MV_Component_Maker, Machine_HV_Component_Maker, + Machine_EV_Component_Maker, Machine_IV_Component_Maker, 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 842f518674..396250dbf7 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 @@ -124,5 +124,17 @@ public interface IGregtech_RecipeAdder { public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Machine Component Assembler. (up to 6 Inputs) + * + * @param aInputs = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) + * @param aOutput1 = Output ItemStack (not null, and respects StackSize) + * @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 addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 795d1762ba..ae05fdcaa4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -5,6 +5,7 @@ import gregtech.api.enums.Materials; import gregtech.api.util.CustomRecipeMap; import gregtech.api.util.GT_Recipe; import gregtech.api.util.Recipe_GT; +import gregtech.common.GT_RecipeAdder; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; @@ -393,5 +394,55 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); return true; } + + //Machine Component Assembler + public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { + if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + return false; + } + if (aOutput1 == null) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("machinecomponents", aOutput1, aDuration)) <= 0) { + return false; + } + Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); + return true; + } + + + + + + + + + + + + + + private boolean areItemsAndFluidsBothNull(final ItemStack[] items, final FluidStack[] fluids) { + boolean itemsNull = true; + if (items != null) { + for (final ItemStack itemStack : items) { + if (itemStack != null) { + itemsNull = false; + break; + } + } + } + boolean fluidsNull = true; + if (fluids != null) { + for (final FluidStack fluidStack : fluids) { + if (fluidStack != null) { + fluidsNull = false; + break; + } + } + } + return itemsNull && fluidsNull; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java new file mode 100644 index 0000000000..d1483f54e3 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java @@ -0,0 +1,130 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import java.util.ArrayList; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.Recipe_GT; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class GregtechComponentAssembler { + + public static void run(){ + GregtechItemList.Machine_LV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(985, "basicmachine.componentmaker.tier.01", "Basic Component Maker", 1, "Components, Unite!", Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[]{"ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4}).getStackForm(1L)); + GregtechItemList.Machine_MV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(986, "basicmachine.componentmaker.tier.02", "Advanced Component Maker", 2, "Components, Unite!", Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[]{"ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4}).getStackForm(1L)); + GregtechItemList.Machine_HV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(987, "basicmachine.componentmaker.tier.03", "Advanced Component Maker II", 3, "Components, Unite!", Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[]{"ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4}).getStackForm(1L)); + GregtechItemList.Machine_EV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(988, "basicmachine.componentmaker.tier.04", "Advanced Component Maker III", 4, "Components, Unite!", Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[]{"ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4}).getStackForm(1L)); + GregtechItemList.Machine_IV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(989, "basicmachine.componentmaker.tier.05", "Advanced Component Maker IV", 5, "Components, Unite!", Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[]{"ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4}).getStackForm(1L)); + + addRecipeMotor(1, Materials.Copper, 1, Materials.Tin, 1, Materials.Iron, Materials.IronMagnetic); + addRecipeMotor(2, Materials.Copper, 2, Materials.Copper, 1, Materials.Aluminium, Materials.SteelMagnetic); + addRecipeMotor(3, Materials.Copper, 4, Materials.Gold, 1, Materials.StainlessSteel, Materials.SteelMagnetic); + addRecipeMotor(4, Materials.Copper, 8, Materials.Aluminium, 1, Materials.Titanium, Materials.NeodymiumMagnetic); + addRecipeMotor(5, Materials.Copper, 16, Materials.Tungsten, 1, Materials.TungstenSteel, Materials.NeodymiumMagnetic); + + addRecipePiston(1, Materials.Steel, Materials.Tin); + addRecipePiston(2, Materials.Aluminium, Materials.Copper); + addRecipePiston(3, Materials.StainlessSteel, Materials.Gold); + addRecipePiston(4, Materials.Titanium, Materials.Aluminium); + addRecipePiston(5, Materials.TungstenSteel, Materials.Tungsten); + + addRecipeConveyor(1, Materials.Tin); + addRecipeConveyor(2, Materials.Copper); + addRecipeConveyor(3, Materials.Gold); + addRecipeConveyor(4, Materials.Aluminium); + addRecipeConveyor(5, Materials.Tungsten); + + + + + + + + + + + + } + + private static boolean addRecipeMotor(int tier, Materials wire, int wirethickness, Materials cable, int cablethickness, Materials stick, Materials magstick){ + String mWT = ""+wirethickness; + String mCT = ""+cablethickness; + + if (wirethickness < 10){ + mWT = "0"+wirethickness; + } + if (cablethickness < 10){ + mCT = "0"+cablethickness; + } + + OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt"+mWT); + OrePrefixes prefixCable = OrePrefixes.getOrePrefix("cableGt"+mCT); + + ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, wire, 4); + ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2); + ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.rod, stick, 2); + ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.rod, magstick, 1); + + ItemStack Input[] = {wireStack, cableStack, rodStack, magrodStack}; + + return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF, ItemList.valueOf("Electric_Motor_"+GT_Values.VN[tier]).get(1), 100, (int) GT_Values.V[tier]); + } + + private static boolean addRecipePiston(int tier, Materials mat, Materials cable){ + + OrePrefixes prefixCable = OrePrefixes.cableGt01; + ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2); + ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.rod, mat, 2); + ItemStack plateStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, mat, 3); + ItemStack gearStack = ItemUtils.getGregtechOreStack(OrePrefixes.gearGtSmall, mat, 1); + ItemStack motorStack = ItemList.valueOf("Electric_Motor_"+GT_Values.VN[tier]).get(1); + + ItemStack Input[] = {plateStack, cableStack, rodStack, gearStack, motorStack}; + + return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF, ItemList.valueOf("Electric_Piston_"+GT_Values.VN[tier]).get(1), 100, (int) GT_Values.V[tier]); + } + + private static boolean addRecipeConveyor(int tier, Materials cable){ + OrePrefixes prefixCable = OrePrefixes.cableGt01; + ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 1); + ItemStack motorStack = ItemList.valueOf("Electric_Motor_"+GT_Values.VN[tier]).get(2); + boolean mAdd[]; + final ArrayList<ItemStack> oreDictList = OreDictionary.getOres("plateAnyRubber"); + if (!oreDictList.isEmpty()){ + int mcount = 0; + mAdd = new boolean[oreDictList.size()]; + for (ItemStack mRubberType : oreDictList){ + final ItemStack returnValue = mRubberType.copy(); + returnValue.stackSize = 6; + ItemStack Input[] = {cableStack, motorStack, returnValue}; + mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF, ItemList.valueOf("Electric_Conveyor_"+GT_Values.VN[tier]).get(1), 100, (int) GT_Values.V[tier]); + } + int added = 0; + for (boolean y : mAdd){ + if (y){ + added++; + } + } + if (added >= (oreDictList.size()/2)){ + return true; + } + else { + return false; + } + } + else { + ItemStack Input[] = {cableStack, motorStack, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateRubber", 6)}; + return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF, ItemList.valueOf("Electric_Piston_"+GT_Values.VN[tier]).get(1), 100, (int) GT_Values.V[tier]); + } + + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java index 452f622498..1c40e98e4e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java @@ -28,6 +28,7 @@ public class GregtechNitroDieselFix { @SuppressWarnings("unchecked") public static void run(){ if (CORE.configSwitches.enableNitroFix){ + Utils.LOG_INFO("Gregtech5u Content | Attempting to Fix Nitro-Diesel production."); if (GT_Mod.VERSION == 509){ Utils.LOG_INFO("[Nitro] Found GT 5.09."); @@ -51,14 +52,14 @@ public class GregtechNitroDieselFix { Utils.LOG_INFO("[Nitro] Created new instance of Material builder, for Nitro fix."); //Get Methods - Method addFluid = mb.getMethod("addFluid"); - Method addCell = mb.getMethod("addCell"); - Method setColour = mb.getMethod("setColour", Dyes.class); - Method setFuelPower = mb.getMethod("setFuelPower", int.class); - Method setMaterials = mb.getMethod("setMaterialList", List.class); - Method setTemp = mb.getMethod("setLiquidTemperature", int.class); - Method setRGB = mb.getMethod("setRGB", int.class, int.class, int.class); - Method construct = mb.getMethod("constructMaterial"); + Method addFluid = mb.getDeclaredMethod("addFluid"); + Method addCell = mb.getDeclaredMethod("addCell"); + Method setColour = mb.getDeclaredMethod("setColor", Dyes.class); + Method setFuelPower = mb.getDeclaredMethod("setFuelPower", int.class); + Method setMaterials = mb.getDeclaredMethod("setMaterialList", List.class); + Method setTemp = mb.getDeclaredMethod("setLiquidTemperature", int.class); + Method setRGB = mb.getDeclaredMethod("setRGB", int.class, int.class, int.class); + Method construct = mb.getDeclaredMethod("constructMaterial"); Utils.LOG_INFO("[Nitro] Got internal methods for setting fields."); //Invoke the methods @@ -69,10 +70,10 @@ public class GregtechNitroDieselFix { setMaterials.invoke(df, Arrays.asList(new MaterialStack(Materials.Glyceryl, 1), new MaterialStack(Materials.Fuel, 4))); setTemp.invoke(df, 295); setRGB.invoke(df, 200, 255, 0); - construct.invoke(df); + Materials mNitroFix = (Materials) construct.invoke(df); Utils.LOG_INFO("[Nitro] Invoked 8 method calls successfully."); - GT_Mod.gregtechproxy.addFluid("NitroFuel_Old", "Nitro Diesel [Old]", ((Materials) df), 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, ((Materials) df), 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + GT_Mod.gregtechproxy.addFluid("NitroFuel_Old", "Nitro Diesel [Old]", mNitroFix, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, mNitroFix, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); Utils.LOG_INFO("[Nitro] Added a fluid."); @@ -131,13 +132,22 @@ public class GregtechNitroDieselFix { Materials mFuels[] = {Materials.LightFuel, Materials.Fuel, Materials.Diesel}; for (Materials fuel : mFuels){ boolean didAdd[] = new boolean[3]; - Utils.LOG_INFO("[Nitro] Getting ready to add back in the old nitro-diesel recipe, using "+fuel.mDefaultLocalName+" as the fuel input."); - didAdd[0] = GT_Values.RA.addMixerRecipe(fuel.getCells(4), Materials.Glycerol.getCells(1), GT_Values.NI, GT_Values.NI, GT_Values.NF, GT_Values.NF, ((Materials) df).getCells(5), 20, 30); - didAdd[1] = GT_Values.RA.addMixerRecipe(fuel.getCells(4), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Glycerol.getFluid(1000L),((Materials) df).getFluid(5000L), ItemList.Cell_Empty.get(4L), 20, 30); - didAdd[2] = GT_Values.RA.addMixerRecipe(Materials.Glycerol.getCells(1), GT_Values.NI,GT_Values.NI,GT_Values.NI, fuel.getFluid(4000L),((Materials) df).getFluid(5000L), ItemList.Cell_Empty.get(1L), 20, 30); - Utils.LOG_INFO("[Nitro] Did the recipe add? 1: "+didAdd[0]+" | 2: "+didAdd[1]+" | 3: "+didAdd[2]); + Utils.LOG_INFO("[Nitro] Getting ready to add back in the old nitro-diesel recipe to the mixer, using "+fuel.mDefaultLocalName+" as the fuel input."); + didAdd[0] = GT_Values.RA.addMixerRecipe(fuel.getCells(4), Materials.Glycerol.getCells(1), GT_Values.NI, GT_Values.NI, GT_Values.NF, GT_Values.NF, mNitroFix.getCells(5), 20, 30); + didAdd[1] = GT_Values.RA.addMixerRecipe(fuel.getCells(4), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Glycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20, 30); + didAdd[2] = GT_Values.RA.addMixerRecipe(Materials.Glycerol.getCells(1), GT_Values.NI,GT_Values.NI,GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20, 30); + Utils.LOG_INFO("[Nitro] Did the recipes add? 1: "+didAdd[0]+" | 2: "+didAdd[1]+" | 3: "+didAdd[2]); + } + + for (Materials fuel : mFuels){ + boolean didAdd[] = new boolean[3]; + Utils.LOG_INFO("[Nitro] Getting ready to add back in the old nitro-diesel recipe to the chemical reactors, using "+fuel.mDefaultLocalName+" as the fuel input."); + didAdd[0] = GT_Values.RA.addChemicalRecipe(fuel.getCells(4), Materials.Glycerol.getCells(1), GT_Values.NF, GT_Values.NF, mNitroFix.getCells(5), 20, 30); + didAdd[1] = GT_Values.RA.addChemicalRecipe(fuel.getCells(4), GT_Values.NI, Materials.Glycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20, 30); + didAdd[2] = GT_Values.RA.addChemicalRecipe(Materials.Glycerol.getCells(1), GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20, 30); + Utils.LOG_INFO("[Nitro] Did the recipes add? 1: "+didAdd[0]+" | 2: "+didAdd[1]+" | 3: "+didAdd[2]); + } - } Utils.LOG_INFO("[Nitro] Getting ready to add back in the old glycerol recipe!"); GT_Values.RA.addChemicalRecipe(Materials.Nitrogen.getCells(1), Materials.Carbon.getDust(1), Materials.Water.getFluid(2000L), Materials.Glycerol.getFluid(3000L), ItemList.Cell_Empty.get(1), 3000, 30); Utils.LOG_INFO("[Nitro] Added recipes."); @@ -153,7 +163,9 @@ public class GregtechNitroDieselFix { } } catch (ClassNotFoundException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException | SecurityException e) { - + Utils.LOG_INFO("[Nitro] ================ Error ================"); + e.printStackTrace(); + Utils.LOG_INFO("[Nitro] ================ Error ================"); } } } |