diff options
author | boubou19 <miisterunknown@gmail.com> | 2024-07-21 16:36:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-21 21:36:34 +0700 |
commit | a8b46c11f5a02608101ef33ed39f103736ba5920 (patch) | |
tree | 6daf492e524dcae9f2f5a8cb1d87c057c21a6760 /src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java | |
parent | 8b077c28bea7bcc046be1e4b8485d69b4c245a43 (diff) | |
download | GT5-Unofficial-a8b46c11f5a02608101ef33ed39f103736ba5920.tar.gz GT5-Unofficial-a8b46c11f5a02608101ef33ed39f103736ba5920.tar.bz2 GT5-Unofficial-a8b46c11f5a02608101ef33ed39f103736ba5920.zip |
full RA1 removal (#2713)
* remove addExtractionRecipes
* remove addPulverisationRecipe
* remove thermalcraft fake compat
* deprecate addAlloySmelterRecipe
* remove fake compat
* remove RA1 fusion recipe usage
* remove RA1 centrifuge recipe usage
* remove RA1 compressor recipe usage
* remove RA1 electrolyzer recipe usage
* remove RA1 chemical reactor recipe usage
* deprecate GT based recipes adders
* obliterate RA1 entries in interfaces (1/?)
* remove RA1 blast furnace recipe usage
* remove RA1 canner recipe usage
* remove RA1 alloy smelter recipe usage
* remove RA1 circuit assembler recipe usage
* obliterate RA1 entries in interfaces (2/?)
* remove RA1 bender recipe usage
* clean class
* remove RA1 cutter recipe usage
* remove RA1 fuels recipe usage
* remove RA1 implosion compressor recipe usage
* remove RA1 thermal centrifuge recipe usage
* clean GT_ModHandler
* obliterate RA1 entries in interfaces (3/?)
* remove RA1 packager recipe usage
* remove RA1 lathe recipe usage
* remove RA1 vacuum freezer recipe usage
* remove RA1 fluid heater recipe usage
* remove RA1 nano forge recipe usage
* remove RA1 autoclave recipe usage
* obliterate RA1 entries in interfaces (4/?)
* remove RA1 cracker recipe usage
* remove RA1 pyrolyse recipe usage
* remove RA1 pulveriser recipe usage
* remove RA1 fluid extractor recipe usage
* remove RA1 assembly line recipe usage
* remove RA1 alloy blast smelter recipe usage
* remove RA1 coke oven recipe usage
* obliterate RA1 entries in interfaces (5/?)
* remove RA1 dehydrator recipe usage
* remove deprecated usages
* obliterate RA1 entries in interfaces (6/?)
* remove RA1 assembler recipe usage
* obliterate RA1 entries in interfaces (7/?)
* remove RA1 mixer recipe usage
* remove RA1 forge hammer recipe usage
* remove RA1 wiremill recipe usage
* remove RA1 extruder recipe usage
* remove RA1 fluid soldifier recipe usage
* remove RA1 chemical bath recipe usage
* remove RA1 electromagnetic separator recipe usage
* remove RA1 sifter recipe usage
* remove distillery recipe usage
* remove distillation tower usage
* remove extractor usage
* obliterate RA1 entries in interfaces (8/?)
* remove QFT usage
* cleaning
* remove packager usage
* remove fluid heater usage
* remove vacuum freezer usage
* remove distillery usage
* fix QFT chances arrays
* remove fission fuel usage
* remove cyclotron usage
* remove molecular transformer usage
* remove chemplant usage
* remove coldtrap and reactor processing unit usage
* obliterate RA1 entries in interfaces (9/?)
* spotlessApply
* fixes
* remove addRecipe calls
* migrate forge of gods recipes
* yeet special value calls (1 / 2)
* yeet special value calls (2 / 2)
* migrate GG Fuel recipes
* migrate all GG maps except EHE
* CORE.RA is no more
* clear GT_RecipeAdder
* remove dead code
* clean RecipeMap a bit
* spotless apply
* fix output chances
* Update RecipeLoader.java
* fix
* remove buggy recipe
* migrate to enum for IDs
* sort enum
* move to enum
* fix recipes
* spotless apply
* fix recipe
* remove useless recipes
* spotless apply
* remove unused blocks
* fix GT++ recipe
* Update RecipeLoader.java
* Update RecipeLoader.java
* fix imports
* Spotless apply for branch remove_RA1_calls for #2713 (#2742)
spotlessApply
Co-authored-by: GitHub GTNH Actions <>
* fix recipe
(cherry picked from commit a25d3b62997f080e064369e940eaf53a96a300e6)
* fix
(cherry picked from commit d9af01140f3ee77de2be18be70f04f8fbe4b547f)
* temporarily remove panic mode
* fix recipes
* Revert "temporarily remove panic mode"
This reverts commit 483cfcf74371b91e7d545f058f9d25ff4fcec95a.
* fix recipes
---------
Co-authored-by: Dream Master <dream-master@gmx.net>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java | 392 |
1 files changed, 194 insertions, 198 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java index 32d6a1066b..eb55f2989c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java @@ -1,11 +1,22 @@ package gtPlusPlus.xmod.gregtech.loaders; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.electrolyzerRecipes; +import static gregtech.api.recipe.RecipeMaps.hammerRecipes; +import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; +import static gregtech.api.recipe.RecipeMaps.thermalCentrifugeRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes; + import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; +import java.util.List; +import java.util.Objects; import java.util.Set; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -14,7 +25,6 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.material.MaterialStack; @@ -195,50 +205,57 @@ public class RecipeGen_Ore extends RecipeGen_Base { * Macerate */ // Macerate ore to Crushed - if (GT_Values.RA.addPulveriserRecipe( - material.getOre(1), - new ItemStack[] { material.getCrushed(2) }, - new int[] { 10000 }, - 20 * 20, - tVoltageMultiplier / 2)) { - Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getOre(1)) + .itemOutputs(material.getCrushed(2)) + .duration(20 * SECONDS) + .eut(tVoltageMultiplier / 2) + .addTo(maceratorRecipes); + + Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'"); + // Macerate raw ore to Crushed - if (GT_Values.RA.addPulveriserRecipe( - material.getRawOre(1), - new ItemStack[] { material.getCrushed(2) }, - new int[] { 10000 }, - 20 * 20, - tVoltageMultiplier / 2)) { - Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate raw ore to Crushed ore'"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getRawOre(1)) + .itemOutputs(material.getCrushed(2)) + .duration(20 * SECONDS) + .eut(tVoltageMultiplier / 2) + .addTo(maceratorRecipes); + + Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate raw ore to Crushed ore'"); + // Macerate Crushed to Impure Dust - if (GT_Values.RA.addPulveriserRecipe( - material.getCrushed(1), - new ItemStack[] { material.getDustImpure(1), matDustA }, - new int[] { 10000, 1000 }, - 20 * 20, - tVoltageMultiplier / 2)) { - Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Crushed ore to Impure Dust'"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getCrushed(1)) + .itemOutputs(material.getDustImpure(1), matDustA) + .outputChances(100_00, 10_00) + .duration(20 * SECONDS) + .eut(tVoltageMultiplier / 2) + .addTo(maceratorRecipes); + + Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Crushed ore to Impure Dust'"); + // Macerate Washed to Purified Dust - if (GT_Values.RA.addPulveriserRecipe( - material.getCrushedPurified(1), - new ItemStack[] { material.getDustPurified(1), matDustA }, - new int[] { 10000, 1000 }, - 20 * 20, - tVoltageMultiplier / 2)) { - Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Washed ore to Purified Dust'"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getCrushedPurified(1)) + .itemOutputs(material.getDustPurified(1), matDustA) + .outputChances(100_00, 10_00) + .duration(20 * SECONDS) + .eut(tVoltageMultiplier / 2) + .addTo(maceratorRecipes); + + Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Washed ore to Purified Dust'"); + // Macerate Centrifuged to Pure Dust - if (GT_Values.RA.addPulveriserRecipe( - material.getCrushedCentrifuged(1), - new ItemStack[] { matDust, matDustA }, - new int[] { 10000, 1000 }, - 20 * 20, - tVoltageMultiplier / 2)) { - Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getCrushedCentrifuged(1)) + .itemOutputs(matDust, matDustA) + .outputChances(100_00, 10_00) + .duration(20 * SECONDS) + .eut(tVoltageMultiplier / 2) + .addTo(maceratorRecipes); + + Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'"); /** * Wash @@ -280,14 +297,16 @@ public class RecipeGen_Ore extends RecipeGen_Base { try { // .08 compat - if (GT_ModHandler.addThermalCentrifugeRecipe( - material.getCrushed(1), - new int[] { 10000, 1111, 10000 }, - (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), - material.getCrushedCentrifuged(1), - matDustB, - dustStone)) { - Logger.MATERIALS( + GT_Values.RA.stdBuilder() + .itemInputs(material.getCrushed(1)) + .itemOutputs(material.getCrushedCentrifuged(1), matDustB, dustStone) + .outputChances(100_00, 11_11, 100_00) + .duration(25 * SECONDS) + .eut(48) + .addTo(thermalCentrifugeRecipes); + + Logger + .MATERIALS( "[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore' | Input: " + material.getCrushed(1) .getDisplayName() @@ -299,86 +318,85 @@ public class RecipeGen_Ore extends RecipeGen_Base { + ", " + dustStone.getDisplayName() + "."); - } + } catch (Throwable t) {} try { - if (GT_ModHandler.addThermalCentrifugeRecipe( - material.getCrushedPurified(1), - new int[] { 10000, 1111, 10000 }, - (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), - material.getCrushedCentrifuged(1), - matDustA, - dustStone)) { - Logger.MATERIALS( - "[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: " - + material.getCrushedPurified(1) - .getDisplayName() - + " | Outputs: " - + material.getCrushedCentrifuged(1) - .getDisplayName() - + ", " - + matDustA.getDisplayName() - + ", " - + dustStone.getDisplayName() - + "."); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getCrushedPurified(1)) + .itemOutputs(material.getCrushedCentrifuged(1), matDustA, dustStone) + .outputChances(100_00, 11_11, 100_00) + .duration(25 * SECONDS) + .eut(48) + .addTo(thermalCentrifugeRecipes); + + Logger.MATERIALS( + "[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: " + + material.getCrushedPurified(1) + .getDisplayName() + + " | Outputs: " + + material.getCrushedCentrifuged(1) + .getDisplayName() + + ", " + + matDustA.getDisplayName() + + ", " + + dustStone.getDisplayName() + + "."); + } catch (Throwable t) {} /** * Forge Hammer */ - if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), matDust, 10, tVoltageMultiplier / 4)) { - Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'"); - } - if (GT_Values.RA.addForgeHammerRecipe( - material.getCrushedPurified(1), - material.getDustPurified(1), - 10, - tVoltageMultiplier / 4)) { - Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Purified to Purified Dust'"); - } - if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, tVoltageMultiplier / 4)) { - Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Ore to Crushed'"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getCrushedCentrifuged(1)) + .itemOutputs(matDust) + .duration(10 * TICKS) + .eut(tVoltageMultiplier / 4) + .addTo(hammerRecipes); + + Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'"); + + GT_Values.RA.stdBuilder() + .itemInputs(material.getCrushedPurified(1)) + .itemOutputs(material.getDustPurified(1)) + .duration(10 * TICKS) + .eut(tVoltageMultiplier / 4) + .addTo(hammerRecipes); + Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Purified to Purified Dust'"); + + GT_Values.RA.stdBuilder() + .itemInputs(material.getOre(1)) + .itemOutputs(material.getCrushed(1)) + .duration(10 * TICKS) + .eut(tVoltageMultiplier / 4) + .addTo(hammerRecipes); + + Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Ore to Crushed'"); /** * Centrifuge */ // Purified Dust to Clean - if (GT_Values.RA.addCentrifugeRecipe( - material.getDustPurified(1), - null, - null, // In Fluid - null, // Out Fluid - matDust, - matDustA, - null, - null, - null, - null, - new int[] { 10000, 1111 }, // Chances - (int) Math.max(1L, material.getMass() * 8L), // Time - tVoltageMultiplier / 2)) { // Eu - Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getDustPurified(1)) + .itemOutputs(matDust, matDustA) + .outputChances(100_00, 11_11) + .eut(tVoltageMultiplier / 2) + .duration((int) Math.max(1L, material.getMass() * 8L)) + .addTo(centrifugeRecipes); + + Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust"); // Impure Dust to Clean - if (GT_Values.RA.addCentrifugeRecipe( - material.getDustImpure(1), - null, - null, // In Fluid - null, // Out Fluid - matDust, - matDustB, - null, - null, - null, - null, - new int[] { 10000, 1111 }, // Chances - (int) Math.max(1L, material.getMass() * 8L), // Time - tVoltageMultiplier / 2)) { // Eu - Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust"); - } + GT_Values.RA.stdBuilder() + .itemInputs(material.getDustImpure(1)) + .itemOutputs(matDust, matDustB) + .outputChances(100_00, 11_11) + .eut(tVoltageMultiplier / 2) + .duration((int) Math.max(1L, material.getMass() * 8L)) + .addTo(centrifugeRecipes); + + Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust"); /** * Electrolyzer @@ -458,6 +476,7 @@ public class RecipeGen_Ore extends RecipeGen_Base { + " as input."); } else { Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, exiting."); + return; } } @@ -471,30 +490,30 @@ public class RecipeGen_Ore extends RecipeGen_Base { } } - try { - if (addElectrolyzerRecipe( - mainDust, - emptyCell, // input 2 - null, // Input fluid 1 - null, // Output fluid 1 - mInternalOutputs[0], - mInternalOutputs[1], - mInternalOutputs[2], - mInternalOutputs[3], - mInternalOutputs[4], - mInternalOutputs[5], - mChances, - (int) Math.max(material.getMass() * 3L * 1, 1), - tVoltageMultiplier)) { - Logger - .MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for " + matDust.getDisplayName()); - } else { - Logger.MATERIALS( - "[Electrolyzer] Failed to generate Electrolyzer recipe for " + matDust.getDisplayName()); - } - } catch (Throwable t) { - t.printStackTrace(); + // i don't understand the mess above, so let's just strip nulls and assume the chances are in correct + // order + List<ItemStack> internalOutputs = Arrays.asList(mInternalOutputs); + internalOutputs.removeIf(Objects::isNull); + int[] chances = new int[internalOutputs.size()]; + for (int i = 0; i < internalOutputs.size(); i++) { + chances[i] = mChances[i]; + } + ItemStack[] inputs; + if (emptyCell == null) { + inputs = new ItemStack[] { mainDust }; + } else { + inputs = new ItemStack[] { mainDust, emptyCell }; } + GT_Values.RA.stdBuilder() + .itemInputs(inputs) + .itemOutputs(internalOutputs.toArray(new ItemStack[0])) + .outputChances(chances) + .duration(Math.max(material.getMass() * 3L * 1, 1)) + .eut(tVoltageMultiplier) + .addTo(electrolyzerRecipes); + + Logger.MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for " + matDust.getDisplayName()); + } else if (componentMap.size() > 6 && componentMap.size() <= 9) { Logger.MATERIALS( "[Issue][Electrolyzer] " + material.getLocalizedName() @@ -573,6 +592,7 @@ public class RecipeGen_Ore extends RecipeGen_Base { + " as input."); } else { Logger.MATERIALS("[Dehydrator] Could not find valid input dust, exiting."); + return; } } @@ -586,33 +606,42 @@ public class RecipeGen_Ore extends RecipeGen_Base { } } - try { - if (CORE.RA.addDehydratorRecipe( - new ItemStack[] { mainDust, emptyCell }, - null, - null, - mInternalOutputs, - mChances, - (int) Math.max(material.getMass() * 4L * 1, 1), - tVoltageMultiplier)) { - Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for " + matDust.getDisplayName()); - Logger.MATERIALS( - "Inputs: " + mainDust.getDisplayName() - + " x" - + mainDust.stackSize - + ", " - + (emptyCell == null ? "No Cells" - : "" + emptyCell.getDisplayName() + " x" + emptyCell.stackSize)); - Logger.MATERIALS("Outputs " + ItemUtils.getArrayStackNames(mInternalOutputs)); - Logger.MATERIALS("Time: " + ((int) Math.max(material.getMass() * 4L * 1, 1))); - Logger.MATERIALS("EU: " + tVoltageMultiplier); - } else { - Logger.MATERIALS( - "[Dehydrator] Failed to generate Dehydrator recipe for " + matDust.getDisplayName()); - } - } catch (Throwable t) { - t.printStackTrace(); + // i don't understand the mess above, so let's just strip nulls and assume the chances are in correct + // order + List<ItemStack> internalOutputs = Arrays.asList(mInternalOutputs); + internalOutputs.removeIf(Objects::isNull); + int[] chances = new int[internalOutputs.size()]; + for (int i = 0; i < internalOutputs.size(); i++) { + chances[i] = mChances[i]; } + + ItemStack[] inputs; + if (emptyCell == null) { + inputs = new ItemStack[] { mainDust }; + } else { + inputs = new ItemStack[] { mainDust, emptyCell }; + } + + GT_Values.RA.stdBuilder() + .itemInputs(inputs) + .itemOutputs(internalOutputs.toArray(new ItemStack[0])) + .outputChances(chances) + .eut(tVoltageMultiplier) + .duration((int) Math.max(material.getMass() * 4L * 1, 1)) + .addTo(chemicalDehydratorRecipes); + + Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for " + matDust.getDisplayName()); + Logger.MATERIALS( + "Inputs: " + mainDust.getDisplayName() + + " x" + + mainDust.stackSize + + ", " + + (emptyCell == null ? "No Cells" + : "" + emptyCell.getDisplayName() + " x" + emptyCell.stackSize)); + Logger.MATERIALS("Outputs " + ItemUtils.getArrayStackNames(mInternalOutputs)); + Logger.MATERIALS("Time: " + ((int) Math.max(material.getMass() * 4L * 1, 1))); + Logger.MATERIALS("EU: " + tVoltageMultiplier); + } } @@ -699,39 +728,6 @@ public class RecipeGen_Ore extends RecipeGen_Base { // } } - public static 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))) { - Logger.MATERIALS("[Electrolyzer] Either both inputs or outputs are null."); - return false; - } - if ((aInput1 != null) && (aDuration <= 0)) { - Logger.MATERIALS("[Electrolyzer] Fail 1."); - return false; - } - if ((aFluidInput != null) && (aDuration <= 0)) { - Logger.MATERIALS("[Electrolyzer] Fail 2."); - return false; - } - GT_Values.RA.addElectrolyzerRecipe( - aInput1, - aInput2, - aFluidInput, - aFluidOutput, - aOutput1, - aOutput2, - aOutput3, - aOutput4, - aOutput5, - aOutput6, - aChances, - aDuration, - aEUt); - Logger.MATERIALS("[Electrolyzer] Recipe added."); - return true; - } - public static ItemStack getTinyDust(Material m) { ItemStack x = m.getTinyDust(1); if (x == null) { |