From 2c19b7b7c6a25eedca517cd9b7f8989a4e62d93b Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Tue, 30 Apr 2024 08:10:13 +0100 Subject: [PATCH] GT recipe.cfg cleanup (#871) remove recipe.cfg uses from gt++ (cherry picked from commit 465898903f3420525d0a597216760069411f9e78) --- .../bop/blocks/BOP_Block_Registrator.java | 15 +++--------- .../xmod/gregtech/loaders/RecipeGen_Ore.java | 7 ++---- .../gregtech/loaders/RecipeGen_Plates.java | 5 +--- .../gregtech/recipes/GregtechRecipeAdder.java | 23 ++++++------------- 4 files changed, 13 insertions(+), 37 deletions(-) diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java index 3266f1b349..e8c50641aa 100644 --- a/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java +++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java @@ -11,8 +11,6 @@ import net.minecraft.item.ItemStack; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -96,9 +94,7 @@ public static void addLogRecipes(final ItemStack aStack) { GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null), new ItemStack(Items.coal, 1, 1))) { addPyrolyeOvenRecipes(aStack); - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) { - GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack)); - } + GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack)); } if (aMeta == 32767) { for (int i = 0; i < 32767; ++i) { @@ -106,10 +102,7 @@ public static void addLogRecipes(final ItemStack aStack) { GT_ModHandler.getSmeltingOutput(new ItemStack(aStack.getItem(), 1, i), false, null), new ItemStack(Items.coal, 1, 1))) { addPyrolyeOvenRecipes(aStack); - if (GregTech_API.sRecipeFile - .get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) { - GT_ModHandler.removeFurnaceSmelting(new ItemStack(aStack.getItem(), 1, i)); - } + GT_ModHandler.removeFurnaceSmelting(new ItemStack(aStack.getItem(), 1, i)); } final ItemStack tStack = GT_ModHandler.getRecipeOutput(new ItemStack(aStack.getItem(), 1, i)); if (tStack == null) { @@ -172,9 +165,7 @@ public static void addLogRecipes(final ItemStack aStack) { GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null), new ItemStack(Items.coal, 1, 1))) { addPyrolyeOvenRecipes(aStack); - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) { - GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack)); - } + GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack)); } } } 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 68799b15d1..10c2066997 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java @@ -7,7 +7,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; @@ -680,13 +679,11 @@ public static boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2 Logger.MATERIALS("[Electrolyzer] Either both inputs or outputs are null."); return false; } - if ((aInput1 != null) - && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) { + if ((aInput1 != null) && (aDuration <= 0)) { Logger.MATERIALS("[Electrolyzer] Fail 1."); return false; } - if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile - .get("electrolyzer", aFluidInput.getFluid().getName(), aDuration)) <= 0)) { + if ((aFluidInput != null) && (aDuration <= 0)) { Logger.MATERIALS("[Electrolyzer] Fail 2."); return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 4c4856a89b..9dd1d47ef1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -192,7 +192,7 @@ public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack if ((aInput == null) || (aShape == null) || (aOutput == null)) { return false; } - if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) { + if (aDuration <= 0) { return false; } RecipeMaps.extruderRecipes.addRecipe( @@ -213,9 +213,6 @@ public static boolean addForgeHammerRecipe(final ItemStack aInput1, final ItemSt if ((aInput1 == null) || (aOutput1 == null)) { return false; } - if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) { - return false; - } RecipeMaps.hammerRecipes.addRecipe( true, new ItemStack[] { aInput1 }, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index fa3d2f36cc..d00c7ca1db 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -5,8 +5,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.recipe.RecipeMaps; @@ -38,13 +36,11 @@ public boolean addCokeOvenRecipe(final ItemStack aInput1, final ItemStack aInput Logger.WARNING("Something was null, returning false"); return false; } - if (aOutput != null && (aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0) { + if (aOutput != null && (aDuration <= 0)) { Logger.WARNING("Something was null, returning false"); return false; } - if (aFluidOutput != null - && (aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) - <= 0) { + if (aFluidOutput != null && (aDuration <= 0)) { Logger.WARNING("Something was null, returning false"); return false; } @@ -284,7 +280,7 @@ public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFlui if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) { aOutput = Materials.PulsatingIron.getMolten(aOutput.amount); } - if ((aDuration = GregTech_API.sRecipeFile.get("blastsmelter", aOutput.getFluid().getName(), aDuration)) <= 0) { + if (aDuration <= 0) { Logger.WARNING("Recipe did not register."); return false; } @@ -694,7 +690,7 @@ public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aD if ((aInput1 == null) || (aOutput1 == null)) { return false; } - if ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0) { + if (aDuration <= 0) { return false; } RecipeMaps.compressorRecipes.addRecipe( @@ -722,9 +718,6 @@ public boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidS if (aIngredient == null || aInput == null || aOutput == null) { return false; } - if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) { - return false; - } GT_Recipe tRecipe = RecipeMaps.brewingRecipes.addRecipe( false, new ItemStack[] { aIngredient }, @@ -910,8 +903,7 @@ public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int i public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { if (aInput != null && aOutput != null) { - if ((aDuration = GregTech_API.sRecipeFile - .get("distillery", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { + if (aDuration <= 0) { return false; } else { GT_Recipe tRecipe = RecipeMaps.distilleryRecipes.addRecipe( @@ -971,9 +963,8 @@ public boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, Item } if (GT_Utility.getContainerItem(aInput, false) == null) { - if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) { - GT_Utility.addSimpleIC2MachineRecipe(aInput, GT_ModHandler.getMaceratorRecipeList(), null, aOutput1); - } + GT_Utility.addSimpleIC2MachineRecipe(aInput, GT_ModHandler.getMaceratorRecipeList(), null, aOutput1); + GT_Values.RA.addPulveriserRecipe( aInput, new ItemStack[] { aOutput1, aOutput2, aOutput3 },