Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
GT recipe.cfg cleanup (#871)
Browse files Browse the repository at this point in the history
remove recipe.cfg uses from gt++
  • Loading branch information
chochem authored Apr 30, 2024
1 parent 7b4f399 commit 4658989
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -96,20 +94,15 @@ 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) {
if (GT_Utility.areStacksEqual(
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) {
Expand Down Expand Up @@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 },
Expand Down

0 comments on commit 4658989

Please sign in to comment.