aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GT_ModHandler.java
diff options
context:
space:
mode:
authorboubou19 <miisterunknown@gmail.com>2024-07-21 16:36:34 +0200
committerGitHub <noreply@github.com>2024-07-21 21:36:34 +0700
commita8b46c11f5a02608101ef33ed39f103736ba5920 (patch)
tree6daf492e524dcae9f2f5a8cb1d87c057c21a6760 /src/main/java/gregtech/api/util/GT_ModHandler.java
parent8b077c28bea7bcc046be1e4b8485d69b4c245a43 (diff)
downloadGT5-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/gregtech/api/util/GT_ModHandler.java')
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java385
1 files changed, 20 insertions, 365 deletions
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index 70dc2f30b0..8c43a5334b 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -10,7 +10,6 @@ import static gregtech.api.enums.GT_Values.RA;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.GT_Values.W;
import static gregtech.api.recipe.RecipeMaps.alloySmelterRecipes;
-import static gregtech.api.recipe.RecipeMaps.extractorRecipes;
import static gregtech.api.recipe.RecipeMaps.oreWasherRecipes;
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
import static gregtech.api.util.GT_RecipeBuilder.TICKS;
@@ -576,184 +575,6 @@ public class GT_ModHandler {
}
/**
- * LiquidTransposer Recipe for both directions
- */
- @Deprecated
- public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid,
- ItemStack aFullContainer, int aMJ) {
- return true;
- }
-
- /**
- * LiquidTransposer Recipe for filling Containers
- */
- @Deprecated
- public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid,
- ItemStack aFullContainer, int aMJ) {
- return true;
- }
-
- /**
- * LiquidTransposer Recipe for emptying Containers
- */
- @Deprecated
- public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid,
- ItemStack aEmptyContainer, int aMJ) {
- return true;
- }
-
- /**
- * IC2-Extractor Recipe. Overloads old Recipes automatically
- */
- @Deprecated
- public static boolean addExtractionRecipe(ItemStack aInput, ItemStack aOutput) {
- aOutput = GT_OreDictUnificator.get(true, aOutput);
- if (aInput == null || aOutput == null) return false;
- RA.stdBuilder()
- .itemInputs(aInput)
- .itemOutputs(aOutput)
- .duration(15 * SECONDS)
- .eut(2)
- .addTo(extractorRecipes);
- return true;
- }
-
- /**
- * RC-BlastFurnace Recipes
- */
- @Deprecated
- public static boolean addRCBlastFurnaceRecipe(ItemStack aInput, ItemStack aOutput, int aTime) {
- return true;
- }
-
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1) {
- return addPulverisationRecipe(aInput, aOutput1, null, 0, false);
- }
-
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2) {
- return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, false);
- }
-
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
- int aChance) {
- return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, false);
- }
-
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, boolean aOverwrite) {
- return addPulverisationRecipe(aInput, aOutput1, null, 0, aOverwrite);
- }
-
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
- boolean aOverwrite) {
- return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, aOverwrite);
- }
-
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance,
- boolean aOverwrite) {
- return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, null, 0, aOverwrite);
- }
-
- /**
- * Adds Several Pulverizer-Type Recipes.
- */
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2,
- ItemStack aOutput3, int aChance3, boolean aOverwrite) {
- aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
- aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
- if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return false;
-
- if (GT_Utility.getContainerItem(aInput, false) == null) {
- RA.addPulveriserRecipe(
- aInput,
- new ItemStack[] { aOutput1, aOutput2, aOutput3 },
- new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 },
- 400,
- 2);
- }
- return true;
- }
-
- @Deprecated
- public static boolean addPulverisationRecipe(ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray,
- int aEUt, int aRecipeDurationInTicks) {
-
- ItemStack[] aUnifiedOutputArray = new ItemStack[aOutputArray.length];
- int counter = 0;
-
- for (ItemStack item : aOutputArray) {
- aUnifiedOutputArray[counter] = GT_OreDictUnificator.get(true, item);
- counter++;
- }
-
- RA.addPulveriserRecipe(aInputItem, aOutputArray, aChanceArray, aRecipeDurationInTicks, aEUt);
-
- return true;
- }
-
- @Deprecated
- public static boolean addImmersiveEngineeringRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
- int aChance2, ItemStack aOutput3, int aChance3) {
- return true;
- }
-
- @Deprecated
- public static boolean addMagneticraftRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2,
- ItemStack aOutput3, int aChance3) {
- return true;
- }
-
- /**
- * Adds a Recipe to the Sawmills of ThermalCraft
- */
- @Deprecated
- public static boolean addSawmillRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2) {
- return true;
- }
-
- /**
- * Induction Smelter Recipes and Alloy Smelter Recipes
- */
- @Deprecated
- public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration,
- int aEUt, boolean aAllowSecondaryInputEmpty) {
- if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return false;
- aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
- RA.stdBuilder()
- .itemInputs(aInput1, aInput2)
- .itemOutputs(aOutput1)
- .duration(aDuration)
- .eut(aEUt)
- .addTo(alloySmelterRecipes);
- return true;
- }
-
- /**
- * Induction Smelter Recipes for TE
- */
- public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1,
- ItemStack aOutput2, int aEnergy, int aChance) {
- return true;
- }
-
- /**
- * Smelts Ores to Ingots
- */
- public static boolean addOreToIngotSmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
- aOutput = GT_OreDictUnificator.get(true, aOutput);
- if (aInput == null || aOutput == null) return false;
- FurnaceRecipes.smelting()
- .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F);
- return true;
- }
-
- /**
* Adds GT versions of the IC2 recipes from the supplied IC2RecipeList.
*/
public static void addIC2RecipesToGT(Map<IRecipeInput, RecipeOutput> aIC2RecipeList, RecipeMap<?> aGTRecipeMap,
@@ -781,35 +602,27 @@ public class GT_ModHandler {
.contains("ic2.itemPurifiedCrushed"))))
continue;
switch (aGTRecipeMap.unlocalizedName) {
- case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> aGTRecipeMap
- .addRecipe(
- true,
- new ItemStack[] { GT_Utility.copyAmount(
+ case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> GT_Values.RA
+ .stdBuilder()
+ .itemInputs(
+ GT_Utility.copyAmount(
iRecipeInputRecipeOutputEntry.getKey()
.getAmount(),
- tStack) },
- iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]),
- null,
- null,
- null,
- null,
- 300,
- 2,
- 0);
- case "gt.recipe.thermalcentrifuge" -> aGTRecipeMap.addRecipe(
- true,
- new ItemStack[] { GT_Utility.copyAmount(
- iRecipeInputRecipeOutputEntry.getKey()
- .getAmount(),
- tStack) },
- iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]),
- null,
- null,
- null,
- null,
- 500,
- 48,
- 0);
+ tStack))
+ .itemOutputs(iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]))
+ .duration(15 * SECONDS)
+ .eut(2)
+ .addTo(aGTRecipeMap);
+ case "gt.recipe.thermalcentrifuge" -> GT_Values.RA.stdBuilder()
+ .itemInputs(
+ GT_Utility.copyAmount(
+ iRecipeInputRecipeOutputEntry.getKey()
+ .getAmount(),
+ tStack))
+ .itemOutputs(iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]))
+ .duration(25 * SECONDS)
+ .eut(48)
+ .addTo(aGTRecipeMap);
}
} catch (Exception e) {
System.err.println(e);
@@ -870,48 +683,10 @@ public class GT_ModHandler {
return emptyRecipeMap;
}
- public static Map<IRecipeInput, RecipeOutput> getMassFabricatorList() {
- try {
- return ic2.api.recipe.Recipes.matterAmplifier.getRecipes();
- } catch (Throwable e) {
- /* Do nothing */
- }
- return emptyRecipeMap;
- }
-
- /**
- * IC2-ThermalCentrifuge Recipe. Overloads old Recipes automatically
- */
- @Deprecated
- public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int[] aChances, int aHeat, Object... aOutput) {
- if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false;
- RA.addThermalCentrifugeRecipe(
- aInput,
- (ItemStack) aOutput[0],
- aOutput.length >= 2 ? (ItemStack) aOutput[1] : null,
- aOutput.length >= 3 ? (ItemStack) aOutput[2] : null,
- aChances,
- 500,
- 48);
- return true;
- }
-
- @Deprecated
- public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int aHeat, Object... aOutput) {
- if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false;
- RA.addThermalCentrifugeRecipe(
- aInput,
- (ItemStack) aOutput[0],
- aOutput.length >= 2 ? (ItemStack) aOutput[1] : null,
- aOutput.length >= 3 ? (ItemStack) aOutput[2] : null,
- 500,
- 48);
- return true;
- }
-
/**
* IC2-OreWasher Recipe. Overloads old Recipes automatically
*/
+ @Deprecated
public static boolean addOreWasherRecipe(ItemStack aInput, int[] aChances, int aWaterAmount, Object... aOutput) {
if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false;
RA.stdBuilder()
@@ -934,76 +709,6 @@ public class GT_ModHandler {
return true;
}
- public static boolean addOreWasherRecipe(ItemStack aInput, int aWaterAmount, Object... aOutput) {
- if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false;
- RA.stdBuilder()
- .itemInputs(aInput)
- .itemOutputs((ItemStack) aOutput[0], (ItemStack) aOutput[1], (ItemStack) aOutput[2])
- .fluidInputs(GT_ModHandler.getWater(aWaterAmount))
- .duration(25 * SECONDS)
- .eut(16)
- .addTo(oreWasherRecipes);
-
- RA.stdBuilder()
- .itemInputs(aInput)
- .itemOutputs((ItemStack) aOutput[0], (ItemStack) aOutput[1], (ItemStack) aOutput[2])
- .fluidInputs(GT_ModHandler.getDistilledWater(aWaterAmount / 5))
- .duration(15 * SECONDS)
- .eut(16)
- .addTo(oreWasherRecipes);
- return true;
- }
-
- /**
- * IC2-Compressor Recipe. Overloads old Recipes automatically
- */
- @Deprecated
- public static boolean addCompressionRecipe(ItemStack aInput, ItemStack aOutput) {
- return addCompressionRecipe(aInput, aOutput, 300, 2);
- }
-
- /**
- * IC2-Compressor Recipe. Overloads old Recipes automatically
- */
- @Deprecated
- public static boolean addCompressionRecipe(ItemStack aInput, ItemStack aOutput, int duration, int EUPerTick) {
- aOutput = GT_OreDictUnificator.get(true, aOutput);
- if (aInput == null || aOutput == null || GT_Utility.areStacksEqual(aInput, aOutput, true)) return false;
- RA.addCompressorRecipe(aInput, aOutput, duration, EUPerTick);
- return true;
- }
-
- /**
- * @param aValue Scrap = 5000, Scrapbox = 45000, Diamond Dust 125000
- */
- public static boolean addIC2MatterAmplifier(ItemStack aAmplifier, int aValue) {
- if (aAmplifier == null || aValue <= 0) return false;
- try {
- NBTTagCompound tNBT = new NBTTagCompound();
- tNBT.setInteger("amplification", aValue);
- GT_Utility
- .callMethod(ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", false, false, false, aAmplifier, tNBT);
- } catch (Throwable e) {
- /* Do nothing */
- }
- return true;
- }
-
- /**
- * Rolling Machine Crafting Recipe
- */
- public static boolean addRollingMachineRecipe(ItemStack aResult, Object[] aRecipe) {
- aResult = GT_OreDictUnificator.get(true, aResult);
- if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return false;
- try {
- mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine.getRecipeList()
- .add(new ShapedOreRecipe(GT_Utility.copyOrNull(aResult), aRecipe));
- } catch (Throwable e) {
- return addCraftingRecipe(GT_Utility.copyOrNull(aResult), aRecipe);
- }
- return true;
- }
-
public static void stopBufferingCraftingRecipes() {
sBufferCraftingRecipes = false;
@@ -2498,54 +2203,4 @@ public class GT_ModHandler {
*/
public static long DONT_REMOVE_SHAPELESS = B[13];
}
-
- /**
- * Copy of the original Helper Class of Thermal Expansion, just to make sure it works even when other Mods include
- * TE-APIs
- */
- public static class ThermalExpansion {
-
- public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) {}
-
- public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput) {}
-
- public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput,
- ItemStack secondaryOutput) {}
-
- public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput,
- ItemStack secondaryOutput, int secondaryChance) {}
-
- public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput) {}
-
- public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput,
- ItemStack secondaryOutput) {}
-
- public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput,
- ItemStack secondaryOutput, int secondaryChance) {}
-
- public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput,
- ItemStack primaryOutput) {}
-
- public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput,
- ItemStack primaryOutput, ItemStack secondaryOutput) {}
-
- public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput,
- ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {}
-
- public static void addSmelterBlastOre(Materials aMaterial) {}
-
- public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {}
-
- public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid,
- boolean reversible) {}
-
- public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid,
- int chance, boolean reversible) {}
-
- public static void addMagmaticFuel(String fluidName, int energy) {}
-
- public static void addCompressionFuel(String fluidName, int energy) {}
-
- public static void addCoolant(String fluidName, int energy) {}
- }
}