From 556586c1871ca56da316472ffa6658d5033446d6 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Mon, 29 May 2023 22:19:38 +0100 Subject: Final stretch for GT RA2 conversions (#2038) * (un)boxing RA2 * fuel ra2 * blast RA2 * primitive blast RA2 * remaining cutter ra2 * fix --- .../common/items/GT_MetaGenerated_Item_01.java | 27 ++- .../java/gregtech/loaders/load/GT_FuelLoader.java | 62 +++++- .../gregtech/loaders/load/GT_ItemIterator.java | 36 +++- .../loaders/oreprocessing/ProcessingCell.java | 47 +++-- .../loaders/oreprocessing/ProcessingCrate.java | 141 +++++++++----- .../loaders/oreprocessing/ProcessingDust.java | 62 +++--- .../loaders/oreprocessing/ProcessingGem.java | 75 +++++--- .../loaders/oreprocessing/ProcessingIngot.java | 79 ++++---- .../loaders/oreprocessing/ProcessingLog.java | 195 +++++++++++++------ .../loaders/oreprocessing/ProcessingOre.java | 102 +++++----- .../oreprocessing/ProcessingOreSmelting.java | 209 +++++++++++++-------- .../loaders/oreprocessing/ProcessingWax.java | 17 +- .../loaders/oreprocessing/ProcessingWire.java | 33 ++-- .../postload/recipes/BlastFurnaceRecipes.java | 158 +++++++--------- 14 files changed, 789 insertions(+), 454 deletions(-) (limited to 'src/main/java/gregtech') diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index b5b00fba5a..3555bf1335 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -3,6 +3,7 @@ package gregtech.common.items; import static gregtech.api.enums.Mods.GalacticraftMars; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCannerRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; @@ -1226,14 +1227,24 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { .duration(3 * SECONDS + 4 * TICKS) .eut(16) .addTo(sAssemblerRecipes); - GT_Values.RA.addBoxingRecipe( - ItemList.Tool_Matches.get(16L), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Paper, 1L), - ItemList.Tool_MatchBox_Full.get(1L), - 64, - 16); - GT_Values.RA - .addUnboxingRecipe(ItemList.Tool_MatchBox_Full.get(1L), ItemList.Tool_Matches.get(16L), null, 32, 16); + GT_Values.RA.stdBuilder() + .itemInputs( + ItemList.Tool_Matches.get(16L), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Paper, 1L)) + .itemOutputs(ItemList.Tool_MatchBox_Full.get(1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(3 * SECONDS + 4 * TICKS) + .eut(16) + .addTo(sBoxinatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Tool_MatchBox_Full.get(1L)) + .itemOutputs(ItemList.Tool_Matches.get(16L)) + .noFluidInputs() + .noFluidOutputs() + .duration(1 * SECONDS + 12 * TICKS) + .eut(16) + .addTo(sBoxinatorRecipes); ItemList.Tool_Lighter_Invar_Empty.set( addItem( diff --git a/src/main/java/gregtech/loaders/load/GT_FuelLoader.java b/src/main/java/gregtech/loaders/load/GT_FuelLoader.java index 7240d9268e..3863b5c952 100644 --- a/src/main/java/gregtech/loaders/load/GT_FuelLoader.java +++ b/src/main/java/gregtech/loaders/load/GT_FuelLoader.java @@ -3,6 +3,8 @@ package gregtech.loaders.load; import static gregtech.api.enums.Mods.BloodMagic; import static gregtech.api.enums.Mods.EnderIO; import static gregtech.api.enums.Mods.Thaumcraft; +import static gregtech.api.util.GT_RecipeConstants.FUEL_TYPE; +import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -18,6 +20,7 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_RecipeConstants; public class GT_FuelLoader implements Runnable { @@ -147,14 +150,55 @@ public class GT_FuelLoader implements Runnable { 0, 20000); - GT_Values.RA.addFuel(GT_ModHandler.getModItem(Thaumcraft.ID, "ItemResource", 1L, 4), null, 4, 5); - GT_Values.RA.addFuel(new ItemStack(Items.experience_bottle, 1), null, 10, 5); - GT_Values.RA.addFuel(new ItemStack(Items.ghast_tear, 1), null, 50, 5); - GT_Values.RA.addFuel( - new ItemStack(Blocks.beacon, 1), - null, - Materials.NetherStar.mFuelPower * 2, - Materials.NetherStar.mFuelType); - GT_Values.RA.addFuel(GT_ModHandler.getModItem(EnderIO.ID, "bucketRocket_fuel", 1), null, 250, 1); + GT_Values.RA.stdBuilder() + .itemInputs(GT_ModHandler.getModItem(Thaumcraft.ID, "ItemResource", 1L, 4)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, 4) + .metadata(FUEL_TYPE, 5) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(Items.experience_bottle, 1)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, 10) + .metadata(FUEL_TYPE, 5) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(Items.ghast_tear, 1)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, 50) + .metadata(FUEL_TYPE, 5) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(Blocks.beacon, 1)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, Materials.NetherStar.mFuelPower * 2) + .metadata(FUEL_TYPE, Materials.NetherStar.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); + GT_Values.RA.stdBuilder() + .itemInputs(GT_ModHandler.getModItem(EnderIO.ID, "bucketRocket_fuel", 1)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, 250) + .metadata(FUEL_TYPE, 1) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } } diff --git a/src/main/java/gregtech/loaders/load/GT_ItemIterator.java b/src/main/java/gregtech/loaders/load/GT_ItemIterator.java index 277bb7b65e..b4a20b65f2 100644 --- a/src/main/java/gregtech/loaders/load/GT_ItemIterator.java +++ b/src/main/java/gregtech/loaders/load/GT_ItemIterator.java @@ -2,6 +2,8 @@ package gregtech.loaders.load; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCannerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeConstants.FUEL_TYPE; +import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -25,6 +27,7 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_RecipeBuilder; +import gregtech.api.util.GT_RecipeConstants; import gregtech.api.util.GT_Utility; import mods.railcraft.api.core.items.IToolCrowbar; @@ -238,10 +241,28 @@ public class GT_ItemIterator implements Runnable { GT_OreDictUnificator.set(OrePrefixes.ore, Materials.Vinteum, new ItemStack(tItem, 1, 0)); } if (tName.equals("item.ArsMagica:purified_vinteum")) { - GT_Values.RA.addFuel(new ItemStack(tItem, 1, 0), null, 256, 5); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(tItem, 1, 0)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, 256) + .metadata(FUEL_TYPE, 5) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if ((tName.equals("item.fieryBlood")) || (tName.equals("item.fieryTears"))) { - GT_Values.RA.addFuel(new ItemStack(tItem, 1, 0), null, 2048, 5); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(tItem, 1, 0)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, 2048) + .metadata(FUEL_TYPE, 5) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (tName.equals("tile.TFRoots")) { GT_ModHandler.addPulverisationRecipe( @@ -253,7 +274,16 @@ public class GT_ItemIterator implements Runnable { new ItemStack(tItem, 1, 0), new ItemStack(Items.stick, 4), new ItemStack(Items.stick, 2)); - GT_Values.RA.addFuel(new ItemStack(tItem, 1, 1), new ItemStack(Items.stick, 4), 32, 5); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(tItem, 1, 1)) + .itemOutputs(new ItemStack(Items.stick, 4)) + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, 32) + .metadata(FUEL_TYPE, 5) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (tName.equals("item.tconstruct.manual")) { GT_OreDictUnificator.registerOre("bookTinkersManual", new ItemStack(tItem, 1, 32767)); diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingCell.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingCell.java index 1f33a3c7bc..61dacd421d 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingCell.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingCell.java @@ -4,6 +4,8 @@ import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sVacuumRecipes; import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.FUEL_TYPE; +import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; import java.util.ArrayList; @@ -19,6 +21,7 @@ import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_RecipeBuilder; +import gregtech.api.util.GT_RecipeConstants; import gregtech.api.util.GT_Utility; public class ProcessingCell implements IOreRecipeRegistrator { @@ -40,13 +43,21 @@ public class ProcessingCell implements IOreRecipeRegistrator { } } else { if (aMaterial.mFuelPower > 0) { - GT_Values.RA.addFuel( - GT_Utility.copyAmount(1L, aStack), - GT_Utility.getFluidForFilledItem(aStack, true) == null - ? GT_Utility.getContainerItem(aStack, true) - : null, - aMaterial.mFuelPower, - aMaterial.mFuelType); + GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder(); + recipeBuilder.itemInputs(GT_Utility.copyAmount(1L, aStack)); + if (GT_Utility.getFluidForFilledItem(aStack, true) == null + && GT_Utility.getContainerItem(aStack, true) != null) { + recipeBuilder.itemOutputs(GT_Utility.getContainerItem(aStack, true)); + } else { + recipeBuilder.noItemOutputs(); + } + recipeBuilder.noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, aMaterial.mFuelPower) + .metadata(FUEL_TYPE, aMaterial.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if ((aMaterial.mMaterialList.size() > 0) && ((aMaterial.mExtraData & 0x3) != 0)) { int tAllAmount = 0; @@ -174,13 +185,21 @@ public class ProcessingCell implements IOreRecipeRegistrator { if (aMaterial == Materials.Empty) { GT_ModHandler.removeRecipeByOutputDelayed(aStack); } else { - GT_Values.RA.addFuel( - GT_Utility.copyAmount(1L, aStack), - GT_Utility.getFluidForFilledItem(aStack, true) == null - ? GT_Utility.getContainerItem(aStack, true) - : null, - (int) Math.max(1024L, 1024L * aMaterial.getMass()), - 4); + GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder(); + recipeBuilder.itemInputs(GT_Utility.copyAmount(1L, aStack)); + if (GT_Utility.getFluidForFilledItem(aStack, true) == null + && GT_Utility.getContainerItem(aStack, true) != null) { + recipeBuilder.itemOutputs(GT_Utility.getContainerItem(aStack, true)); + } else { + recipeBuilder.noItemOutputs(); + } + recipeBuilder.noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, (int) Math.max(1024L, 1024L * aMaterial.getMass())) + .metadata(FUEL_TYPE, 4) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); if (GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L) != null) { GT_Values.RA.stdBuilder() .itemInputs(GT_Utility.copyAmount(1L, aStack)) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrate.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrate.java index d61d2bfc7b..410800f614 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrate.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrate.java @@ -1,11 +1,14 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; + import net.minecraft.item.ItemStack; import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; public class ProcessingCrate implements gregtech.api.interfaces.IOreRecipeRegistrator { @@ -24,72 +27,112 @@ public class ProcessingCrate implements gregtech.api.interfaces.IOreRecipeRegist && !aMaterial.contains(SubTag.NO_WORKING); switch (aPrefix) { case crateGtDust -> { - GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(16L, GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 16L)), - ItemList.Crate_Empty.get(1L), - GT_OreDictUnificator.get(OrePrefixes.crateGtDust, aMaterial, 1L), - 100, - 8); - GT_Values.RA.addUnboxingRecipe( - GT_OreDictUnificator.get(OrePrefixes.crateGtDust, aMaterial, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 16L), - ItemList.Crate_Empty.get(1L), - 800, - 1); + if (GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L) != null) { + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.crateGtDust, aMaterial, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(5 * SECONDS) + .eut(8) + .addTo(sBoxinatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(OrePrefixes.crateGtDust, aMaterial, 1L)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(40 * SECONDS) + .eut(1) + .addTo(sUnboxinatorRecipes); + } if (aSpecialRecipeReq2) GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 16L), GT_Proxy.tBits, new Object[] { "Xc", 'X', OrePrefixes.crateGtDust.get(aMaterial) }); } case crateGtIngot -> { - GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(16L, GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 16L)), - ItemList.Crate_Empty.get(1L), - GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L), - 100, - 8); - GT_Values.RA.addUnboxingRecipe( - GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L), - GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 16L), - ItemList.Crate_Empty.get(1L), - 800, - 1); + if (GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L) != null) { + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(5 * SECONDS) + .eut(8) + .addTo(sBoxinatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(40 * SECONDS) + .eut(1) + .addTo(sUnboxinatorRecipes); + } if (aSpecialRecipeReq2) GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 16L), GT_Proxy.tBits, new Object[] { "Xc", 'X', OrePrefixes.crateGtIngot.get(aMaterial) }); } case crateGtGem -> { - GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(16L, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 16L)), - ItemList.Crate_Empty.get(1L), - GT_OreDictUnificator.get(OrePrefixes.crateGtGem, aMaterial, 1L), - 100, - 8); - GT_Values.RA.addUnboxingRecipe( - GT_OreDictUnificator.get(OrePrefixes.crateGtGem, aMaterial, 1L), - GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 16L), - ItemList.Crate_Empty.get(1L), - 800, - 1); + if (GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L) != null) { + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.crateGtGem, aMaterial, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(5 * SECONDS) + .eut(8) + .addTo(sBoxinatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(OrePrefixes.crateGtGem, aMaterial, 1L)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(40 * SECONDS) + .eut(1) + .addTo(sUnboxinatorRecipes); + } if (aSpecialRecipeReq2) GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 16L), GT_Proxy.tBits, new Object[] { "Xc", 'X', OrePrefixes.crateGtGem.get(aMaterial) }); } case crateGtPlate -> { - GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(16L, GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 16L)), - ItemList.Crate_Empty.get(1L), - GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L), - 100, - 8); - GT_Values.RA.addUnboxingRecipe( - GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L), - GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 16L), - ItemList.Crate_Empty.get(1L), - 800, - 1); + if (GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L) != null) { + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(5 * SECONDS) + .eut(8) + .addTo(sBoxinatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 16L), + ItemList.Crate_Empty.get(1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(40 * SECONDS) + .eut(1) + .addTo(sUnboxinatorRecipes); + } if (aSpecialRecipeReq2) GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 16L), GT_Proxy.tBits, diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java index 7ca1f0cb15..270606f2a0 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java @@ -1,6 +1,8 @@ package gregtech.loaders.oreprocessing; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCannerRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes; @@ -9,6 +11,8 @@ import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sImplosionRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; import static gregtech.api.util.GT_RecipeConstants.FUEL_TYPE; import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; @@ -90,19 +94,23 @@ public class ProcessingDust implements gregtech.api.interfaces.IOreRecipeRegistr if (aMaterial.mBlastFurnaceRequired) { GT_ModHandler.removeFurnaceSmelting(aStack); if (aMaterial.mAutoGenerateBlastFurnaceRecipes) { - GT_Values.RA.addBlastRecipe( - GT_Utility.copyAmount(1L, aStack), - ItemList.Circuit_Integrated.getWithDamage(0L, 1L), - null, - null, - aMaterial.mBlastFurnaceTemp > 1750 - ? GT_OreDictUnificator - .get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L) - : GT_Utility.copyAmount(1L, tDustStack), - null, - (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, - 120, - aMaterial.mBlastFurnaceTemp); + GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder(); + recipeBuilder + .itemInputs(GT_Utility.copyAmount(1L, aStack), GT_Utility.getIntegratedCircuit(1)); + if (aMaterial.mBlastFurnaceTemp > 1750) { + recipeBuilder.itemOutputs( + GT_OreDictUnificator + .get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L)); + } else { + recipeBuilder.itemOutputs(GT_Utility.copyAmount(1L, tDustStack)); + } + recipeBuilder.noFluidInputs() + .noFluidOutputs() + .duration( + (Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp) * TICKS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, (int) aMaterial.mBlastFurnaceTemp) + .addTo(sBlastRecipes); } } else { GT_ModHandler.addSmeltingRecipe(aStack, tDustStack); @@ -650,12 +658,14 @@ public class ProcessingDust implements gregtech.api.interfaces.IOreRecipeRegistr } } case dustSmall -> { - GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(4L, aStack), - ItemList.Schematic_Dust.get(0L), - GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), - 20, - 4); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(4L, aStack), ItemList.Schematic_Dust.get(0L)) + .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(1 * SECONDS) + .eut(4) + .addTo(sBoxinatorRecipes); if (!aMaterial.mBlastFurnaceRequired) { GT_RecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { @@ -670,12 +680,14 @@ public class ProcessingDust implements gregtech.api.interfaces.IOreRecipeRegistr } } case dustTiny -> { - GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(9L, aStack), - ItemList.Schematic_Dust.get(0L), - GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), - 20, - 4); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(9L, aStack), ItemList.Schematic_Dust.get(0L)) + .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(1 * SECONDS) + .eut(4) + .addTo(sBoxinatorRecipes); if (!aMaterial.mBlastFurnaceRequired) { GT_RecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java index cfb97560f1..6694cbe5e3 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java @@ -11,6 +11,8 @@ import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.FUEL_TYPE; +import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; import static gregtech.api.util.GT_Utility.calculateRecipeEU; import net.minecraft.init.Blocks; @@ -27,6 +29,7 @@ import gregtech.api.enums.SubTag; import gregtech.api.enums.TierEU; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_RecipeConstants; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; @@ -56,11 +59,16 @@ public class ProcessingGem implements gregtech.api.interfaces.IOreRecipeRegistra case gem -> { // fuel recipes if (aFuelPower) { - GT_Values.RA.addFuel( - GT_Utility.copyAmount(1L, aStack), - null, - aMaterial.mFuelPower * 2, - aMaterial.mFuelType); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, aMaterial.mFuelPower * 2) + .metadata(FUEL_TYPE, aMaterial.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (!OrePrefixes.block.isIgnored(aMaterial) @@ -333,11 +341,16 @@ public class ProcessingGem implements gregtech.api.interfaces.IOreRecipeRegistra case gemChipped -> { // Fuel recipes if (aFuelPower) { - GT_Values.RA.addFuel( - GT_Utility.copyAmount(1L, aStack), - null, - aMaterial.mFuelPower / 2, - aMaterial.mFuelType); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, aMaterial.mFuelPower / 2) + .metadata(FUEL_TYPE, aMaterial.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (!aNoWorking) { @@ -439,11 +452,16 @@ public class ProcessingGem implements gregtech.api.interfaces.IOreRecipeRegistra case gemExquisite -> { // Fuel recipes if (aFuelPower) { - GT_Values.RA.addFuel( - GT_Utility.copyAmount(1L, aStack), - null, - aMaterial.mFuelPower * 8, - aMaterial.mFuelType); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, aMaterial.mFuelPower * 8) + .metadata(FUEL_TYPE, aMaterial.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (!aNoWorking) { @@ -475,8 +493,16 @@ public class ProcessingGem implements gregtech.api.interfaces.IOreRecipeRegistra case gemFlawed -> { // fuel recipes if (aFuelPower) { - GT_Values.RA - .addFuel(GT_Utility.copyAmount(1L, aStack), null, aMaterial.mFuelPower, aMaterial.mFuelType); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, aMaterial.mFuelPower) + .metadata(FUEL_TYPE, aMaterial.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (!aNoWorking) { @@ -589,11 +615,16 @@ public class ProcessingGem implements gregtech.api.interfaces.IOreRecipeRegistra // Fuel recipes if (aFuelPower) { - GT_Values.RA.addFuel( - GT_Utility.copyAmount(1L, aStack), - null, - aMaterial.mFuelPower * 4, - aMaterial.mFuelType); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, aMaterial.mFuelPower * 4) + .metadata(FUEL_TYPE, aMaterial.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (!aNoWorking) { diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java index 831e179fc0..221a79ec4d 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java @@ -6,6 +6,8 @@ import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sVacuumRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.FUEL_TYPE; +import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; import static gregtech.api.util.GT_Utility.calculateRecipeEU; import net.minecraft.item.ItemStack; @@ -14,6 +16,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_RecipeConstants; import gregtech.api.util.GT_RecipeRegistrator; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; @@ -39,11 +42,19 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist && !aMaterial.contains(SubTag.NO_SMASHING); switch (aPrefix) { - case ingot: + case ingot -> { // Fuel recipe if (aMaterial.mFuelPower > 0) { - GT_Values.RA - .addFuel(GT_Utility.copyAmount(1L, aStack), null, aMaterial.mFuelPower, aMaterial.mFuelType); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .noItemOutputs() + .noFluidInputs() + .noFluidOutputs() + .metadata(FUEL_VALUE, aMaterial.mFuelPower) + .metadata(FUEL_TYPE, aMaterial.mFuelType) + .duration(0) + .eut(0) + .addTo(GT_RecipeConstants.Fuel); } if (aMaterial.mStandardMoltenFluid != null && !(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) { @@ -58,27 +69,25 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist .eut(calculateRecipeEU(aMaterial, 8)) .addTo(sFluidSolidficationRecipes); } - // Reverse recipes - { - GT_RecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); - GT_RecipeRegistrator - .registerReverseMacerating(aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false); - if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { - GT_RecipeRegistrator.registerReverseArcSmelting( - GT_Utility.copyAmount(1L, aStack), - aMaterial, - aPrefix.mMaterialAmount, - null, - null, - null); + // Reverse recipes + { + GT_RecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); + GT_RecipeRegistrator + .registerReverseMacerating(aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false); + if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { + GT_RecipeRegistrator.registerReverseArcSmelting( + GT_Utility.copyAmount(1L, aStack), + aMaterial, + aPrefix.mMaterialAmount, + null, + null, + null); + } } - } - ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L); if ((tStack != null) && ((aMaterial.mBlastFurnaceRequired) || aNoSmelting)) { GT_ModHandler.removeFurnaceSmelting(tStack); } - if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial) && !aMaterial.contains(SubTag.NO_WORKING) && !aMaterial.contains(SubTag.SMELTING_TO_GEM) @@ -89,7 +98,6 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist GT_Proxy.tBits, new Object[] { ToolDictNames.craftingToolMortar, OrePrefixes.ingot.get(aMaterial) }); } - if (!aNoSmashing) { // Forge hammer recipes if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { @@ -183,9 +191,8 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist } } } - break; - - case ingotDouble: + } + case ingotDouble -> { if (!aNoSmashing) { // bender recipes { @@ -218,9 +225,8 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist new Object[] { "I", "I", "h", 'I', OrePrefixes.ingot.get(aMaterial) }); } } - break; - - case ingotTriple: + } + case ingotTriple -> { if (!aNoSmashing) { // Bender recipes { @@ -253,9 +259,8 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist OrePrefixes.ingot.get(aMaterial) }); } } - break; - - case ingotQuadruple: + } + case ingotQuadruple -> { if (!aNoSmashing) { // Bender recipes { @@ -280,9 +285,8 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist OrePrefixes.ingot.get(aMaterial) }); } } - break; - - case ingotQuintuple: + } + case ingotQuintuple -> { if (!aNoSmashing) { // Bender recipes { @@ -307,9 +311,8 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist OrePrefixes.ingot.get(aMaterial) }); } } - break; - - case ingotHot: + } + case ingotHot -> { if (aMaterial.mAutoGenerateVacuumFreezerRecipes && GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L) != null) { // Vacuum freezer recipes @@ -322,10 +325,8 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist .eut(TierEU.RECIPE_MV) .addTo(sVacuumRecipes); } - break; - - default: - break; + } + default -> {} } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java index a7615dda69..ad6daa2299 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java @@ -4,6 +4,7 @@ import static gregtech.api.enums.Mods.Railcraft; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCutterRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtractorRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; @@ -159,38 +160,76 @@ public class ProcessingLog implements gregtech.api.interfaces.IOreRecipeRegistra } } else { ItemStack tPlanks = GT_Utility.copyOrNull(tStack); - tPlanks.stackSize = (tPlanks.stackSize * 3 / 2); - GT_Values.RA.addCutterRecipe( - new ItemStack(aStack.getItem(), 1, i), - Materials.Lubricant.getFluid(1L), - GT_Utility.copyOrNull(tPlanks), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), - 200, - 8); - GT_Values.RA.addCutterRecipe( - new ItemStack(aStack.getItem(), 1, i), - GT_Utility.copyAmount( - GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4, - tStack), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), - 200, - 8); - GT_ModHandler.addSawmillRecipe( - new ItemStack(aStack.getItem(), 1, i), - tPlanks, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); - GT_ModHandler.removeRecipeDelayed(new ItemStack(aStack.getItem(), 1, i)); - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount( - GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4, - tStack), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "s", "L", 'L', new ItemStack(aStack.getItem(), 1, i) }); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility - .copyAmount(tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { new ItemStack(aStack.getItem(), 1, i) }); + if (tPlanks != null) { + tPlanks.stackSize = (tPlanks.stackSize * 3 / 2); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(aStack.getItem(), 1, i)) + .itemOutputs( + GT_Utility.copyOrNull(tPlanks), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)) + .fluidInputs(Materials.Lubricant.getFluid(1L)) + .noFluidOutputs() + .duration(10 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(aStack.getItem(), 1, i)) + .itemOutputs( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize + : tStack.stackSize * 5L / 4, + tStack), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) + .fluidInputs(Materials.Water.getFluid(Math.min(1000, 200 * 8 / 320))) + .noFluidOutputs() + .duration(20 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(aStack.getItem(), 1, i)) + .itemOutputs( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize + : tStack.stackSize * 5L / 4, + tStack), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) + .fluidInputs(GT_ModHandler.getDistilledWater(3)) + .noFluidOutputs() + .duration(20 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(aStack.getItem(), 1, i)) + .itemOutputs( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize + : tStack.stackSize * 5L / 4, + tStack), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) + .fluidInputs(Materials.Lubricant.getFluid(1)) + .noFluidOutputs() + .duration(10 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_ModHandler.addSawmillRecipe( + new ItemStack(aStack.getItem(), 1, i), + tPlanks, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + GT_ModHandler.removeRecipeDelayed(new ItemStack(aStack.getItem(), 1, i)); + GT_ModHandler + .addCraftingRecipe( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize + : tStack.stackSize * 5L / 4, + tStack), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "s", "L", 'L', new ItemStack(aStack.getItem(), 1, i) }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility + .copyAmount(tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { new ItemStack(aStack.getItem(), 1, i) }); + } } } } else { @@ -206,35 +245,69 @@ public class ProcessingLog implements gregtech.api.interfaces.IOreRecipeRegistra ItemStack tStack = GT_ModHandler.getRecipeOutput(GT_Utility.copyAmount(1L, aStack)); if (tStack != null) { ItemStack tPlanks = GT_Utility.copyOrNull(tStack); - tPlanks.stackSize = (tPlanks.stackSize * 3 / 2); - GT_Values.RA.addCutterRecipe( - GT_Utility.copyAmount(1L, aStack), - Materials.Lubricant.getFluid(1L), - GT_Utility.copyOrNull(tPlanks), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), - 200, - 8); - GT_Values.RA.addCutterRecipe( - GT_Utility.copyAmount(1L, aStack), - GT_Utility.copyAmount( - GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4, - tStack), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), - 200, - 8); - GT_ModHandler.addSawmillRecipe( - GT_Utility.copyAmount(1L, aStack), - tPlanks, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); - GT_ModHandler.removeRecipeDelayed(GT_Utility.copyAmount(1L, aStack)); - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount( - GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4, - tStack), - new Object[] { "s", "L", 'L', GT_Utility.copyAmount(1L, aStack) }); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack), - new Object[] { GT_Utility.copyAmount(1L, aStack) }); + if (tPlanks != null) { + tPlanks.stackSize = (tPlanks.stackSize * 3 / 2); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .itemOutputs( + GT_Utility.copyOrNull(tPlanks), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)) + .fluidInputs(Materials.Lubricant.getFluid(1L)) + .noFluidOutputs() + .duration(10 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .itemOutputs( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5L / 4, + tStack), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) + .fluidInputs(Materials.Water.getFluid(Math.min(1000, 200 * 8 / 320))) + .noFluidOutputs() + .duration(20 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .itemOutputs( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5L / 4, + tStack), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) + .fluidInputs(GT_ModHandler.getDistilledWater(3)) + .noFluidOutputs() + .duration(20 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.copyAmount(1L, aStack)) + .itemOutputs( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5L / 4, + tStack), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) + .fluidInputs(Materials.Lubricant.getFluid(1)) + .noFluidOutputs() + .duration(10 * SECONDS) + .eut(8) + .addTo(sCutterRecipes); + GT_ModHandler.addSawmillRecipe( + GT_Utility.copyAmount(1L, aStack), + tPlanks, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + GT_ModHandler.removeRecipeDelayed(GT_Utility.copyAmount(1L, aStack)); + GT_ModHandler.addCraftingRecipe( + GT_Utility.copyAmount( + GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5L / 4, + tStack), + new Object[] { "s", "L", 'L', GT_Utility.copyAmount(1L, aStack) }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility + .copyAmount(tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack), + new Object[] { GT_Utility.copyAmount(1L, aStack) }); + } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java index de0298d547..f0ffe2d39b 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java @@ -1,8 +1,10 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; import java.util.ArrayList; @@ -98,15 +100,15 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra ItemStack tDust = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, tGem, 1L); ItemStack tCleaned = GT_OreDictUnificator.get(OrePrefixes.crushedPurified, tMaterial, tDust, 1L); ItemStack tCrushed = GT_OreDictUnificator - .get(OrePrefixes.crushed, tMaterial, aMaterial.mOreMultiplier * aMultiplier); + .get(OrePrefixes.crushed, tMaterial, (long) aMaterial.mOreMultiplier * aMultiplier); ItemStack tPrimaryByProduct = null; if (tCrushed == null) { tCrushed = GT_OreDictUnificator.get( OrePrefixes.dustImpure, tMaterial, - GT_Utility.copyAmount(aMaterial.mOreMultiplier * aMultiplier, tCleaned, tDust, tGem), - aMaterial.mOreMultiplier * aMultiplier); + GT_Utility.copyAmount((long) aMaterial.mOreMultiplier * aMultiplier, tCleaned, tDust, tGem), + (long) aMaterial.mOreMultiplier * aMultiplier); } ArrayList tByProductStacks = new ArrayList<>(); @@ -149,54 +151,66 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra } else { tHasSmelting = GT_ModHandler.addSmeltingRecipe( aOreStack, - GT_Utility.copyAmount(aMultiplier * aMaterial.mSmeltingMultiplier, tSmeltInto)); + GT_Utility.copyAmount((long) aMultiplier * aMaterial.mSmeltingMultiplier, tSmeltInto)); } if (aMaterial.contains(SubTag.BLASTFURNACE_CALCITE_TRIPLE)) { if (aMaterial.mAutoGenerateBlastFurnaceRecipes) { - GT_Values.RA.addBlastRecipe( - aOreStack, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcite, aMultiplier), - null, - null, - GT_Utility.mul(aMultiplier * 3 * aMaterial.mSmeltingMultiplier, tSmeltInto), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.DarkAsh, 1L), - tSmeltInto.stackSize * 500, - 120, - 1500); - GT_Values.RA.addBlastRecipe( - aOreStack, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Quicklime, aMultiplier), - null, - null, - GT_Utility.mul(aMultiplier * 3 * aMaterial.mSmeltingMultiplier, tSmeltInto), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.DarkAsh, 1L), - tSmeltInto.stackSize * 500, - 120, - 1500); + GT_Values.RA.stdBuilder() + .itemInputs( + aOreStack, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcite, aMultiplier)) + .itemOutputs( + GT_Utility.mul((long) aMultiplier * 3 * aMaterial.mSmeltingMultiplier, tSmeltInto), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.DarkAsh, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(tSmeltInto.stackSize * 25 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 1500) + .addTo(sBlastRecipes); + GT_Values.RA.stdBuilder() + .itemInputs( + aOreStack, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Quicklime, aMultiplier)) + .itemOutputs( + GT_Utility.mul((long) aMultiplier * 3 * aMaterial.mSmeltingMultiplier, tSmeltInto), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.DarkAsh, 1L)) + .noFluidInputs() + .noFluidOutputs() + .duration(tSmeltInto.stackSize * 25 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 1500) + .addTo(sBlastRecipes); } } else if (aMaterial.contains(SubTag.BLASTFURNACE_CALCITE_DOUBLE)) { if (aMaterial.mAutoGenerateBlastFurnaceRecipes) { - GT_Values.RA.addBlastRecipe( - aOreStack, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcite, aMultiplier), - null, - null, - GT_Utility.mul(aMultiplier * 2 * aMaterial.mSmeltingMultiplier, tSmeltInto), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.DarkAsh, 1L), - tSmeltInto.stackSize * 500, - 120, - 1500); - GT_Values.RA.addBlastRecipe( - aOreStack, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Quicklime, aMultiplier), -