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

Fix several recipes #842

Merged
merged 5 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public List<Pos2d> getItemInputPositions(int itemInputCount) {

@Override
public List<Pos2d> getItemOutputPositions(int itemOutputCount) {
return UIHelper.getGridPositions(itemOutputCount, 106, 15, 2);
return UIHelper.getGridPositions(itemOutputCount, 106, 6, 2);
}

@Override
Expand All @@ -42,7 +42,7 @@ public List<Pos2d> getFluidInputPositions(int fluidInputCount) {

@Override
public List<Pos2d> getFluidOutputPositions(int fluidOutputCount) {
return UIHelper.getGridPositions(fluidOutputCount, 142, 15, 1, fluidOutputCount);
return UIHelper.getGridPositions(fluidOutputCount, 142, 6, 1, fluidOutputCount);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class GTPPRecipeMaps {
ItemUtils.getItemStackFromFQRN("AdvancedSolarPanel:BlockMolecularTransformer", 1)))
.build();
public static final RecipeMap<RecipeMapBackend> chemicalPlantRecipes = RecipeMapBuilder
.of("gtpp.recipe.fluidchemicaleactor").maxIO(4, 4, 4, 2)
.of("gtpp.recipe.fluidchemicaleactor").maxIO(4, 6, 4, 3)
.slotOverlays((index, isFluid, isOutput, isSpecial) -> {
if (isFluid) {
if (isOutput) {
Expand Down
54 changes: 21 additions & 33 deletions src/main/java/gtPlusPlus/core/item/chemistry/CoalTar.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package gtPlusPlus.core.item.chemistry;

import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
import static gregtech.api.util.GT_RecipeConstants.UniversalChemical;
import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes;

import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;

import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
Expand All @@ -30,22 +35,15 @@ public class CoalTar extends ItemPackage {
public static Fluid Naphthalene;

private static void recipeEthylBenzineFuelsIntoHeavyFuel() {
CORE.RA.addChemicalRecipe(
ItemUtils.getItemStackOfAmountFromOreDict("cellFuel", 9),
ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
null,
FluidUtils.getFluidStack("nitrofuel", 7500),
ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 11),
100,
1000);
CORE.RA.addChemicalRecipe(
ItemUtils.getItemStackOfAmountFromOreDict("cellBioDiesel", 9),
ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
null,
FluidUtils.getFluidStack("nitrofuel", 3000),
ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 11),
300,
1000);
GT_Values.RA.stdBuilder().itemInputs(Materials.Fuel.getCells(9))
.fluidInputs(FluidUtils.getFluidStack(Ethylbenzene, 2000)).itemOutputs(ItemList.Cell_Empty.get(9L))
.fluidOutputs(Materials.NitroFuel.getFluid(7500)).duration(5 * SECONDS).eut(1000).noOptimize()
.addTo(UniversalChemical);

GT_Values.RA.stdBuilder().itemInputs(Materials.BioDiesel.getCells(9))
.fluidInputs(FluidUtils.getFluidStack(Ethylbenzene, 4000)).itemOutputs(ItemList.Cell_Empty.get(9L))
.fluidOutputs(Materials.NitroFuel.getFluid(6000)).duration(5 * SECONDS).eut(1000).noOptimize()
.addTo(UniversalChemical);
}

public static void recipeCreateEthylene() {
Expand Down Expand Up @@ -81,16 +79,9 @@ public static void recipeCreateEthylene() {

public static void recipeCreateBenzene() {
// C7H8 + 2H = CH4 + C6H6
CORE.RA.addDehydratorRecipe(
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellToluene", 1),
ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2) },
null,
null,
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellMethane", 1),
ItemUtils.getItemStackOfAmountFromOreDict("cellBenzene", 1), Materials.Empty.getCells(1) },
new int[] { 10000, 10000, 10000 },
20 * 10,
90);
GT_Values.RA.stdBuilder().itemInputs(Materials.Toluene.getCells(1)).itemOutputs(Materials.Benzene.getCells(1))
.fluidInputs(Materials.Hydrogen.getGas(2000)).fluidOutputs(Materials.Methane.getGas(1000))
.duration(10 * SECONDS).eut(90).noOptimize().addTo(chemicalDehydratorRecipes);
}

public static void recipeCreateEthylbenzene() {
Expand Down Expand Up @@ -231,13 +222,10 @@ private static void recipeCoalTarOilToSulfuricOilToNaphthalene() {

private static void recipeNaphthaleneToPhthalicAcid() {
// SulfuricCoalTarOil
GT_Values.RA.addChemicalRecipe(
ItemUtils.getItemStackOfAmountFromOreDict("cellNaphthalene", 2),
ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 5),
null,
Materials.PhthalicAcid.getFluid(2500),
ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2),
20 * 16);
GT_Values.RA.stdBuilder().itemInputs(Materials.Lithium.getDust(5))
.fluidInputs(FluidUtils.getFluidStack(Naphthalene, 2000))
.fluidOutputs(Materials.PhthalicAcid.getFluid(2500)).eut(30).duration(16 * SECONDS).noOptimize()
.addTo(UniversalChemical);
}

private static void recipePhthalicAcidToPhthalicAnhydride() {
Expand Down
15 changes: 5 additions & 10 deletions src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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;
import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes;

import net.minecraft.init.Items;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -741,16 +742,10 @@ private void recipe2Ethylanthrahydroquinone() {

private void recipeLithiumPeroxide() {
// 2HLiO2 = Li2O2 + H2O2
CORE.RA.addDehydratorRecipe(
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 8),
ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1) },
null,
null,
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 4),
ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1), },
new int[] { 10000, 10000 },
20 * 100,
120);
GT_Values.RA.stdBuilder().itemInputs(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 8))
.fluidOutputs(FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000))
.itemOutputs(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 4))
.duration(100 * SECONDS).eut(120).noOptimize().addTo(chemicalDehydratorRecipes);
}

private void recipeLithiumHydroperoxide() {
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,6 @@ private static void createLOH() {
GT_Values.RA.stdBuilder().itemInputs(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1))
.itemOutputs(ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidHydrogen", 1)).duration(16 * SECONDS)
.eut(TierEU.RECIPE_MV).addTo(vacuumFreezerRecipes);

CORE.RA.addAdvancedFreezerRecipe(
new ItemStack[] {},
new FluidStack[] { FluidUtils.getFluidStack("hydrogen", 300) },
new FluidStack[] { FluidUtils.getFluidStack(Liquid_Hydrogen, 300) },
new ItemStack[] {},
new int[] {},
20 * 4,
540,
0);
}

private static void createHydratedAmmoniumNitrateSlurry() {
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
Original file line number Diff line number Diff line change
Expand Up @@ -1550,20 +1550,6 @@ private static void cyclotronRecipes() {
2500);

// Generate Hydrogen Plasma Recipe
CORE.RA.addCyclotronRecipe(
new ItemStack[] { Particle.getIon("Hydrogen", 0),
ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1) },
null,
new ItemStack[] { Particle.getBaseParticle(Particle.PROTON), Particle.getBaseParticle(Particle.NEUTRON),
Particle.getBaseParticle(Particle.ELECTRON), Particle.getBaseParticle(Particle.UNKNOWN),
Particle.getBaseParticle(Particle.UNKNOWN), Particle.getBaseParticle(Particle.UNKNOWN),
CI.emptyCells(1) },
FluidUtils.getFluidStack("plasma.hydrogen", 100),
new int[] { 1250, 1250, 1250, 750, 750, 750, 10000 },
20 * 60 * 2,
(int) MaterialUtils.getVoltageForTier(6),
750 * 20);

CORE.RA.addCyclotronRecipe(
new ItemStack[] { CI.getNumberedCircuit(21), Particle.getIon("Hydrogen", 0), },
FluidUtils.getFluidStack("hydrogen", 1000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
import static gtPlusPlus.core.material.MISC_MATERIALS.BRINE;
import static gtPlusPlus.core.material.MISC_MATERIALS.HYDROGEN_CHLORIDE;
import static gtPlusPlus.core.material.MISC_MATERIALS.HYDROGEN_CHLORIDE_MIX;
import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_HIGH;
import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_LOW;
import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_MID;
Expand Down Expand Up @@ -76,12 +77,10 @@ public static void init() {
.itemOutputs(ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 2)).duration(10 * SECONDS)
.eut(TierEU.RECIPE_HV).addTo(mixerRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(
ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 4),
GregtechItemList.Laser_Lens_WoodsGlass.get(0))
.itemOutputs(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 4))
.duration(30 * SECONDS).eut(TierEU.RECIPE_HV).noOptimize().addTo(laserEngraverRecipes);
GT_Values.RA.stdBuilder().itemInputs(GregtechItemList.Laser_Lens_WoodsGlass.get(0))
.fluidInputs(HYDROGEN_CHLORIDE_MIX.getFluidStack(4000))
.fluidOutputs(HYDROGEN_CHLORIDE.getFluidStack(4000)).duration(30 * SECONDS).eut(TierEU.RECIPE_HV)
.noOptimize().addTo(laserEngraverRecipes);

// Set Material Tiers correctly
ORES.GREENOCKITE.vTier = 1;
Expand Down
37 changes: 17 additions & 20 deletions src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import static gregtech.api.util.GT_RecipeConstants.FUEL_TYPE;
import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE;
import static gregtech.api.util.GT_RecipeConstants.UniversalChemical;
import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes;
import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalPlantRecipes;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -443,15 +445,11 @@ private static void recipeAceticAcid() {
60,
1);

CORE.RA.addDehydratorRecipe(
new ItemStack[] { CI.getNumberedBioCircuit(14), CI.emptyCells(1) },
FluidUtils.getFluidStack(mFermentationBase, 1000),
null,
new ItemStack[] { ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 2),
ItemUtils.getItemStackOfAmountFromOreDict("cellAceticAcid", 1) },
new int[] { 10000, 10000 },
60 * 20,
16);
GT_Values.RA.stdBuilder().itemInputs(CI.getNumberedBioCircuit(14))
.fluidInputs(FluidUtils.getFluidStack(mFermentationBase, 1000))
.fluidOutputs(FluidUtils.getFluidStack(mAceticAcid, 1000))
.itemOutputs(ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 2)).duration(60 * SECONDS).eut(16)
.noOptimize().addTo(chemicalDehydratorRecipes);
}

public static final HashSet<GT_ItemStack> mFruits = new HashSet<>();
Expand Down Expand Up @@ -581,18 +579,17 @@ private static void recipeFermentationBase() {
}

// Produce Acetone, Butanol and Ethanol
CORE.RA.addChemicalPlantRecipe(
new ItemStack[] { getBioChip(5), ItemUtils.getItemStackOfAmountFromOreDict("cellFermentationBase", 48),
GT_Values.RA.stdBuilder()
.itemInputs(
getBioChip(5),
ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 6),
ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16), },
new FluidStack[] {},
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 18),
ItemUtils.getItemStackOfAmountFromOreDict("cellAcetone", 9),
ItemUtils.getItemStackOfAmountFromOreDict("cellEthanol", 3), CI.emptyCells(18) },
new FluidStack[] {},
100 * 20,
32,
1);
ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16))
.fluidInputs(FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 48000))
.fluidOutputs(
FluidUtils.getFluidStack(BioRecipes.mButanol, 18000),
FluidUtils.getFluidStack(BioRecipes.mAcetone, 9000),
FluidUtils.getFluidStack(BioRecipes.mEthanol, 3000))
.duration(100 * SECONDS).eut(32).specialValue(1).noOptimize().addTo(chemicalPlantRecipes);
}

private static void recipePropionicAcid() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
import static gregtech.api.util.GT_RecipeBuilder.TICKS;
import static gregtech.api.util.GT_RecipeConstants.FUSION_THRESHOLD;
import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes;

import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -293,19 +294,15 @@ private static void chemicalReactorRecipes() {
private static void dehydratorRecipes() {

// Makes 7-Lithium
CORE.RA.addDehydratorRecipe(
new ItemStack[] { CI.getNumberedAdvancedCircuit(14),
ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricLithium", 1) },
FluidUtils.getFluidStack("sulfuriclithium", 440),
null,
new ItemStack[] { CI.emptyCells(1), ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3),
GT_Values.RA.stdBuilder().itemInputs(CI.getNumberedAdvancedCircuit(14))
.fluidInputs(FluidUtils.getFluidStack("sulfuriclithium", 1440))
.itemOutputs(
ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3),
ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1),
ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 1),
ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1),
ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 4) },
new int[] { 10000, 10000, 10000, 10000, 10000 },
30 * 20,
30);
ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 4))
.duration(30 * SECONDS).eut(30).addTo(chemicalDehydratorRecipes);

// Makes Lithium Carbonate
CORE.RA.addDehydratorRecipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addCokeOvenRecipe(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
final FluidStack aFluidOutput, final ItemStack aOutput, int aDuration, final int aEUt) {
if (aInput1 == null || (aOutput == null || aFluidOutput == null)) {
if (aInput1 == null || (aOutput == null && aFluidOutput == null)) {
Logger.WARNING("Something was null, returning false");
return false;
}
if ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0) {
if (aOutput != null && (aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0) {
Logger.WARNING("Something was null, returning false");
return false;
}
if ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0) {
if (aFluidOutput != null
&& (aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration))
<= 0) {
Logger.WARNING("Something was null, returning false");
return false;
}
Expand Down Expand Up @@ -857,7 +859,7 @@ public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFl
@Override
public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs,
FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier) {
if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 4 || aFluidOutputs.length > 2) {
if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 6 || aFluidOutputs.length > 3) {
Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs));
Logger.INFO("Fluid Inputs: " + ItemUtils.getArrayStackNames(aInputFluids));
Logger.INFO("Outputs: " + ItemUtils.getArrayStackNames(aOutputs));
Expand Down