diff options
Diffstat (limited to 'src/main/java/gregtech/common')
3 files changed, 298 insertions, 3365 deletions
diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index f0225fd241..8f48ec19bf 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -1,3242 +1,11 @@ package gregtech.common; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.Mods.GTPlusPlus; -import static gregtech.api.enums.Mods.Railcraft; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.Objects; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.internal.IGT_RecipeAdder; -import gregtech.api.objects.ItemData; -import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GT_AssemblyLineUtils; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_RecipeBuilder; -import gregtech.api.util.GT_RecipeConstants; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.extensions.ArrayExt; -import ic2.core.init.MainConfig; -import ic2.core.util.ConfigUtil; -import mods.railcraft.common.blocks.aesthetics.cube.EnumCube; -import mods.railcraft.common.items.RailcraftToolItems; public class GT_RecipeAdder implements IGT_RecipeAdder { @Override - @Deprecated - public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, - int aEUt, int aStartEU) { - return false; - } - - @Deprecated - @Override // Really? - public boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, - int aEUt, int aStartEU) { - if (aInput1 == null || aInput2 == null || aOutput1 == null || aDuration < 1 || aEUt < 1 || aStartEU < 1) { - return false; - } - RecipeMaps.fusionRecipes.addRecipe( - null, - new FluidStack[] { aInput1, aInput2 }, - new FluidStack[] { aOutput1 }, - aDuration, - aEUt, - aStartEU); - return true; - } - - @Deprecated - @Override - public boolean addFusionReactorRecipe(FluidStack[] FluidInputArray, FluidStack[] FluidOutputArray, - int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion) { - if (FluidInputArray.length == 0) return false; - - if (FluidOutputArray.length == 0) return false; - - RecipeMaps.fusionRecipes.addRecipe( - null, - FluidInputArray, - FluidOutputArray, - aFusionDurationInTicks, - aFusionEnergyPerTick, - aEnergyNeededForStartingFusion); - return true; - } - - @Deprecated - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration) { - return addCentrifugeRecipe( - aInput1, - aInput2 < 0 ? null : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2) : null, - null, - null, - aOutput1, - aOutput2, - aOutput3, - aOutput4, - aOutput5, - aOutput6, - null, - aDuration, - 5); - } - - @Deprecated - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { - return addCentrifugeRecipe( - aInput1, - aInput2 < 0 ? null : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2) : null, - null, - null, - aOutput1, - aOutput2, - aOutput3, - aOutput4, - aOutput5, - aOutput6, - null, - aDuration, - aEUt); - } - - @Deprecated - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, - ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { - return addCentrifugeRecipe( - aInput1, - aInput2, - aFluidInput, - aFluidOutput, - aOutput1, - aOutput2, - aOutput3, - aOutput4, - aOutput5, - aOutput6, - aChances, - aDuration, - aEUt, - false); - } - - @Deprecated - @Override - public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, - ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom) { - if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { - return false; - } - if ((aInput1 != null) && (aDuration <= 0)) { - return false; - } - if ((aFluidInput != null) && (aDuration <= 0)) { - return false; - } - if (!GT_Mod.gregtechproxy.mEnableCleanroom) { - aCleanroom = false; - } - RecipeMaps.centrifugeRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, }, - null, - aChances, - new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, - aDuration, - aEUt, - aCleanroom ? -100 : 0); - ItemStack[] itemInputs = { aInput1, aInput2 }; - ItemStack[] itemOutputs = { aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6 }; - FluidStack[] fluidInputs = { aFluidInput, null, null }; - FluidStack[] fluidOutputs = { aFluidOutput, null, null, null, null, null, null }; - - byte iNumber = 0; - byte oNumber = 0; - - for (ItemStack item : itemInputs) { - if (item != null) { - if (GT_Utility.getFluidForFilledItem(aInput1, true) != null || GT_Utility.isCellEmpty(item)) { - fluidInputs[iNumber + 1] = GT_Utility.convertCellToFluid(item); - itemInputs[iNumber] = null; - } - } - iNumber++; - } - - for (ItemStack item : itemOutputs) { - if (item != null) { - if (GT_Utility.getFluidForFilledItem(item, true) != null || GT_Utility.isCellEmpty(item)) { - fluidOutputs[oNumber + 1] = GT_Utility.convertCellToFluid(item); - itemOutputs[oNumber] = null; - } - } - oNumber++; - } - - RecipeMaps.centrifugeNonCellRecipes.addRecipe( - false, - itemInputs, - itemOutputs, - null, - aChances, - fluidInputs, - fluidOutputs, - aDuration, - aEUt, - aCleanroom ? -100 : 0); - return true; - } - - @Deprecated - @Override - public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if (aDuration <= 0) { - return false; - } - RecipeMaps.compressorRecipes.addRecipe( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - aDuration, - aEUt, - 0); - return true; - } - - @Deprecated - @Override - public boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { - return addElectrolyzerRecipe( - aInput1, - aInput2 < 0 ? null : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2) : null, - null, - null, - aOutput1, - aOutput2, - aOutput3, - aOutput4, - aOutput5, - aOutput6, - null, - aDuration, - aEUt); - } - - @Deprecated - @Override - public boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, - ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { - if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { - return false; - } - if ((aInput1 != null) && (aDuration <= 0)) { - return false; - } - if ((aFluidInput != null) && (aDuration <= 0)) { - return false; - } - RecipeMaps.electrolyzerRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6 }, - null, - aChances, - new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, - aDuration, - aEUt, - 0); - ItemStack[] itemInputs = { aInput1, aInput2 }; - ItemStack[] itemOutputs = { aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6 }; - FluidStack[] fluidInputs = { aFluidInput, null, null }; - FluidStack[] fluidOutputs = { aFluidOutput, null, null, null, null, null, null }; - - byte iNumber = 0; - byte oNumber = 0; - - for (ItemStack item : itemInputs) { - if (item != null) { - if (GT_Utility.getFluidForFilledItem(item, true) != null || GT_Utility.isCellEmpty(item) - || GT_Utility.isAnyIntegratedCircuit(item)) { - fluidInputs[iNumber + 1] = GT_Utility.convertCellToFluid(item); - itemInputs[iNumber] = null; - } - } - iNumber++; - } - - for (ItemStack item : itemOutputs) { - if (item != null) { - if (GT_Utility.getFluidForFilledItem(item, true) != null || GT_Utility.isCellEmpty(item)) { - fluidOutputs[oNumber + 1] = GT_Utility.convertCellToFluid(item); - itemOutputs[oNumber] = null; - } - } - oNumber++; - } - - RecipeMaps.electrolyzerNonCellRecipes - .addRecipe(false, itemInputs, itemOutputs, null, aChances, fluidInputs, fluidOutputs, aDuration, aEUt, 0); - return true; - } - - @Deprecated - @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration) { - return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration); - } - - @Deprecated - @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration, int aEUt) { - return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration, aEUt); - } - - @Deprecated - @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput, int aDuration) { - return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, 30); - } - - @Deprecated - @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration) { - return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, 30); - } - - @Deprecated - @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUTick) { - return addChemicalRecipe( - aInput1, - aInput2, - aFluidInput, - aFluidOutput, - aOutput, - GT_Values.NI, - aDuration, - aEUTick); - } - - @Deprecated - @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { - return addChemicalRecipe( - aInput1, - aInput2, - aFluidInput, - aFluidOutput, - aOutput, - aOutput2, - aDuration, - aEUtick, - false); - } - - @Deprecated - @Override - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, - boolean aCleanroom) { - if (((aInput1 == null) && (aFluidInput == null)) - || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { - return false; - } - if ((aOutput != null || aOutput2 != null) && (aDuration <= 0)) { - return false; - } - if ((aFluidOutput != null) && (aDuration <= 0)) { - return false; - } - if (aEUtick <= 0) { - return false; - } - if (!GT_Mod.gregtechproxy.mEnableCleanroom) { - aCleanroom = false; - } - GT_RecipeBuilder builder = stdBuilder() - .itemInputs(ArrayExt.withoutNulls(new ItemStack[] { aInput1, aInput2 }, ItemStack[]::new)) - .itemOutputs(ArrayExt.withoutNulls(new ItemStack[] { aOutput, aOutput2 }, ItemStack[]::new)); - if (aFluidInput != null) builder.fluidInputs(aFluidInput); - if (aFluidOutput != null) builder.fluidOutputs(aFluidOutput); - builder.duration(aDuration) - .eut(aEUtick) - .metadata(GT_RecipeConstants.CLEANROOM, aCleanroom) - .addTo(GT_RecipeConstants.UniversalChemical); - return true; - } - - @Deprecated - @Override - public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick) { - if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) { - return false; - } - if (aEUtick <= 0) { - return false; - } - RecipeMaps.multiblockChemicalReactorRecipes - .addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0); - return true; - } - - @Deprecated - @Override - public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { - if (((aInput1 == null) && (aFluidInput == null)) - || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { - return false; - } - if ((aOutput != null || aOutput2 != null) && (aDuration <= 0)) { - return false; - } - if ((aFluidOutput != null) && (aDuration <= 0)) { - return false; - } - if (aEUtick <= 0) { - return false; - } - RecipeMaps.chemicalReactorRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput, aOutput2 }, - null, - null, - new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, - aDuration, - aEUtick, - 0); - return true; - } - - @Deprecated - @Override - public void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, ItemStack aBasicMaterialCell, Fluid aPolymer) { - // Oxygen/Titaniumtetrafluoride -> +50% Output each - addChemicalRecipe( - ItemList.Cell_Air.get(1), - GT_Utility.getIntegratedCircuit(1), - new FluidStack(aBasicMaterial, 144), - new FluidStack(aPolymer, 144), - Materials.Empty.getCells(1), - 160); - addChemicalRecipe( - Materials.Oxygen.getCells(1), - GT_Utility.getIntegratedCircuit(1), - new FluidStack(aBasicMaterial, 144), - new FluidStack(aPolymer, 216), - Materials.Empty.getCells(1), - 160); - addChemicalRecipe( - aBasicMaterialCell, - GT_Utility.getIntegratedCircuit(1), - Materials.Air.getGas(14000), - new FluidStack(aPolymer, 1000), - Materials.Empty.getCells(1), - 1120); - addChemicalRecipe( - aBasicMaterialCell, - GT_Utility.getIntegratedCircuit(1), - Materials.Oxygen.getGas(7000), - new FluidStack(aPolymer, 1500), - Materials.Empty.getCells(1), - 1120); - addMultiblockChemicalRecipe( - new ItemStack[] { GT_Utility.getIntegratedCircuit(2) }, - new FluidStack[] { new FluidStack(aBasicMaterial, 2160), Materials.Air.getGas(7500), - Materials.Titaniumtetrachloride.getFluid(100) }, - new FluidStack[] { new FluidStack(aPolymer, 3240) }, - null, - 800, - 30); - addMultiblockChemicalRecipe( - new ItemStack[] { GT_Utility.getIntegratedCircuit(2) }, - new FluidStack[] { new FluidStack(aBasicMaterial, 2160), Materials.Oxygen.getGas(7500), - Materials.Titaniumtetrachloride.getFluid(100) }, - new FluidStack[] { new FluidStack(aPolymer, 4320) }, - null, - 800, - 30); - } - - @Deprecated - @Override - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt, int aLevel) { - return addBlastRecipe(aInput1, aInput2, null, null, aOutput1, aOutput2, aDuration, aEUt, aLevel); - } - - @Override - @Deprecated - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if (aDuration <= 0) { - return false; - } - RecipeMaps.blastFurnaceRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, - aDuration, - aEUt, - aLevel); - return true; - } - - @Deprecated - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, - FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - ItemStack aOutput4, int aDuration, int aEUt, int aLevel) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if (aDuration <= 0) { - return false; - } - RecipeMaps.blastFurnaceRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, aInput3, aInput4 }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, - null, - null, - new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, - aDuration, - aEUt, - aLevel); - return true; - } - - @Deprecated - @Override - public boolean addPlasmaForgeRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, - ItemStack[] OutputItemArray, FluidStack[] FluidOutputArray, int aDuration, int aEUt, int coil_heat_level) { - RecipeMaps.plasmaForgeRecipes.addRecipe( - false, - ItemInputArray, - OutputItemArray, - null, - null, - FluidInputArray, - FluidOutputArray, - aDuration, - aEUt, - coil_heat_level); - return true; - } - - @Override - @Deprecated - public boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, - ItemStack aOutput2, int aDuration) { - if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) { - return false; - } - if (aCoalAmount <= 0) { - return false; - } - if (aDuration <= 0) { - return false; - } - Materials[] coals = new Materials[] { Materials.Coal, Materials.Charcoal }; - for (Materials coal : coals) { - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, coal.getGems(aCoalAmount) }, - new ItemStack[] { aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount) }, - null, - null, - null, - null, - aDuration, - 0, - 0); - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, coal.getDust(aCoalAmount) }, - new ItemStack[] { aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount) }, - null, - null, - null, - null, - aDuration, - 0, - 0); - } - if (Railcraft.isModLoaded()) { - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2) }, - new ItemStack[] { aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2) }, - null, - null, - null, - null, - aDuration * 2 / 3, - 0, - 0); - } - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, - GT_ModHandler.getModItem(GTPlusPlus.ID, "itemCactusCoke", (aCoalAmount * 2L)) }, - new ItemStack[] { aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2) }, - null, - null, - null, - null, - aDuration * 2 / 3, - 0, - 0); - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, - GT_ModHandler.getModItem(GTPlusPlus.ID, "itemSugarCoke", (aCoalAmount * 2L)) }, - new ItemStack[] { aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2) }, - null, - null, - null, - null, - aDuration * 2 / 3, - 0, - 0); - if ((aInput1 == null || aInput1.stackSize <= 6) && (aInput2 == null || aInput2.stackSize <= 6) - && (aOutput1 == null || aOutput1.stackSize <= 6) - && (aOutput2 == null || aOutput2.stackSize <= 6)) { - aInput1 = aInput1 == null ? null : GT_Utility.copyAmount(aInput1.stackSize * 10, aInput1); - aInput2 = aInput2 == null ? null : GT_Utility.copyAmount(aInput2.stackSize * 10, aInput2); - aOutput1 = aOutput1 == null ? null : GT_Utility.copyAmount(aOutput1.stackSize * 10, aOutput1); - aOutput2 = aOutput2 == null ? null : GT_Utility.copyAmount(aOutput2.stackSize * 10, aOutput2); - for (Materials coal : coals) { - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, coal.getBlocks(aCoalAmount) }, - new ItemStack[] { aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount) }, - null, - null, - null, - null, - aDuration * 10, - 0, - 0); - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, coal.getBlocks(aCoalAmount) }, - new ItemStack[] { aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount) }, - null, - null, - null, - null, - aDuration * 10, - 0, - 0); - } - if (Railcraft.isModLoaded()) { - RecipeMaps.primitiveBlastRecipes.addRecipe( - true, - new ItemStack[] { aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2) }, - new ItemStack[] { aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2) }, - null, - null, - null, - null, - aDuration * 20 / 3, - 0, - 0); - } - } - return true; - } - - @Override - @Deprecated - public boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if (aDuration <= 0) { - return false; - } - RecipeMaps.cannerRecipes.addRecipe( - true, - aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - aDuration, - Math.max(aEUt, 1), - 0); - return true; - } - - @Override - @Deprecated - public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, - int aEUt) { - return addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt, false); - } - - @Override - @Deprecated - public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, - int aEUt, boolean hidden) { - if ((aInput1 == null) || (aOutput1 == null || Materials.Graphite.contains(aInput1))) { - return false; - } - if ((aInput2 == null) && ((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) - || (OrePrefixes.gem.contains(aInput1)))) { - return false; - } - if (aDuration <= 0) { - return false; - } - GT_Recipe tRecipe = new GT_Recipe( - true, - aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - aDuration, - Math.max(aEUt, 1), - 0); - if (hidden) { - tRecipe.mHidden = true; - } - RecipeMaps.alloySmelterRecipes.addRecipe(tRecipe); - return true; - } - - @Override - @Deprecated - public boolean addLatheRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if (aDuration <= 0) { - return false; - } - RecipeMaps.latheRecipes.addRecipe( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - aDuration, - aEUt, - 0); - return true; - } - - @Override - @Deprecated - public boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt) { - if ((aInput == null) || (aLubricant == null) || (aOutput1 == null)) { - return false; - } - if (aDuration <= 0) { - return false; - } - RecipeMaps.cutterRecipes.addRecipe( - true, - new ItemStack[] { aInput }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - new FluidStack[] { aLubricant }, - null, - aDuration, - aEUt, - 0); - return true; - } - - @Override - @Deprecated - public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, - boolean aCleanroom) { - return addCutterRecipe(aInput, null, aOutput1, aOutput2, aDuration, aEUt, aCleanroom); - } - - @Deprecated - public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt) { - return addCutterRecipe(aInput, aCircuit, aOutput1, aOutput2, aDuration, aEUt, false); - } - - @Deprecated - public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt, boolean aCleanroom) { - return addCutterRecipe( - aInput, - GT_Utility.getIntegratedCircuit(aCircuit), - aOutput1, - aOutput2, - aDuration, - aEUt, - aCleanroom); - } - - @Override - @Deprecated - public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { - return addCutterRecipe(aInput, aOutput1, aOutput2, aDuration, aEUt, false); - } - - @Override - @Deprecated - public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt) { - return addCutterRecipe(aInput, aCircuit, aOutput1, aOutput2, aDuration, aEUt, false); - } - - @Override - @Deprecated - public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt, boolean aCleanroom) { - return addCutterRecipe( - new ItemStack[] { aInput, aCircuit }, - new ItemStack[] { aOutput1, aOutput2 }, - aDuration, - aEUt, - aCleanroom ? -200 : 0); - } - - @Deprecated - public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, - boolean aCleanroom) { - return addCutterRecipe(aInputs, aOutputs, aDuration, aEUt, aCleanroom ? -200 : 0); - } - - @Override - @Deprecated - public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial) { - if ((aInputs == null) || (aOutputs == null) || aInputs.length == 0 || aOutputs.length == 0) { - return false; - } - if (Arrays.stream(aOutputs) - .noneMatch(Objects::nonNull)) { - return false; - } - if (aDuration <= 0) { - return false; - } - if (!GT_Mod.gregtechproxy.mEnableCleanroom && aSpecial == -200) { - aSpecial = 0; - } - RecipeMaps.cutterRecipes.addRecipe( - true, - aInputs, - aOutputs, - null, - new FluidStack[] { Materials.Water.getFluid(Math.max(4, Math.min(1000, aDuration * aEUt / 320))) }, - null, - aDuration * 2, - aEUt, - aSpecial); - RecipeMaps.cutterRecipes.addRecipe( - true, - aInputs, - aOutputs, - null, - new FluidStack[] { GT_ModHandler.getDistilledWater(Math.max(3, Math.min(750, aDuration * aEUt / 426))) }, - null, - aDuration * 2, - aEUt, - aSpecial); - RecipeMaps.cutterRecipes.addRecipe( - true, - aInputs, - aOutputs, - null, - new FluidStack[] { Materials.Lubricant.getFluid(Math.max(1, Math.min(250, aDuration * aEUt / 1280))) }, - null, - aDuration, - aEUt, - aSpecial); - return true; - } - - @Override - @Deprecated - public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict, int aAmount, FluidStack aFluidInput, - ItemStack aOutput1, int aDuration, int aEUt) { - for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)) { - if (GT_Utility.isStackValid(tStack)) addAssemblerRecipe( - aInput1, - GT_Utility.copyAmount(aAmount, tStack), - aFluidInput, - aOutput1, - aDuration, - aEUt); - } - return true; - } - - @Override - @Deprecated - public boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, - ItemStack aOutput1, int aDuration, int aEUt) { - for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)) { - if (GT_Utility.isStackValid(tStack)) { - ItemStack[] extendedInputs = new ItemStack[aInputs.length + 1]; - System.arraycopy(aInputs, 0, extendedInputs, 0, aInputs.length); - extendedInputs[aInputs.length] = GT_Utility.copyAmount(aAmount, tStack); - addAssemblerRecipe(extendedInputs, aFluidInput, aOutput1, aDuration, aEUt); - } - } - return true; - } - - @Override - @Deprecated - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, - int aEUt) { - return addAssemblerRecipe( - new ItemStack[] { aInput1, aInput2 == null ? aInput1 : aInput2 }, - null, - aOutput1, - aDuration, - aEUt, - false); - } - - @Override - @Deprecated - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, - int aDuration, int aEUt) { - return addAssemblerRecipe(new ItemStack[] { aInput1, aInput2 }, aFluidInput, aOutput1, aDuration, aEUt); - } - - @Override - @Deprecated - public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, - int aEUt) { - return addAssemblerRecipe(aInputs, aFluidInput, aOutput1, aDuration, aEUt, false); - } - - @Override - @Deprecated - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, - int aDuration, int aEUt, boolean aCleanroom) { - if (aInput2 == null) |
