Skip to content

Commit

Permalink
Merge pull request #26 from GTNewHorizons/fix_ra1_calls
Browse files Browse the repository at this point in the history
fix RA1 calls
  • Loading branch information
Dream-Master authored Jul 21, 2024
2 parents 7ebd27c + 1076f3d commit 702bc70
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 41 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.48.82:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.48.97:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.6.14-GTNH:dev')
compileOnly('com.github.GTNewHorizons:MyTown2:0.5.4-GTNH:dev')
}
91 changes: 51 additions & 40 deletions src/main/java/com/sinthoras/hydroenergy/blocks/HEBlockRecipes.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.sinthoras.hydroenergy.blocks;

import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;

import net.minecraft.item.ItemStack;

import com.github.technus.tectech.thing.CustomItemList;
Expand All @@ -12,13 +15,19 @@
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
import gregtech.api.enums.TierEU;
import gregtech.api.interfaces.IItemContainer;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;

public class HEBlockRecipes {

// TODO: Fill up recipe components as needed
private static boolean isSolderingMaterial(Materials material) {
return material.mStandardMoltenFluid != null && material.contains(SubTag.SOLDERING_MATERIAL)
&& !(GregTech_API.mUseOnlyGoodSolderingMaterials && !material.contains(SubTag.SOLDERING_MATERIAL_GOOD));
}

public static void registerRecipes() {
// ULV is disabled!
IItemContainer[] hulls = { null, // ULV,
Expand Down Expand Up @@ -78,51 +87,53 @@ public static void registerRecipes() {
};

for (Materials material : Materials.values()) {
if (material.mStandardMoltenFluid != null && material.contains(SubTag.SOLDERING_MATERIAL)
&& !(GregTech_API.mUseOnlyGoodSolderingMaterials
&& !material.contains(SubTag.SOLDERING_MATERIAL_GOOD))) {
int multiplier = material.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1
: material.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;
if (!isSolderingMaterial(material)) {
continue;
}

GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { ItemList.Casing_SolidSteel.get(1L),
new ItemStack(GregTech_API.sBlockConcretes, 2, 8), ItemList.Cover_Screen.get(1L),
ItemList.FluidRegulator_MV.get(2L), GT_Utility.getIntegratedCircuit(1) },
material.getMolten(144L * multiplier / 2L),
HE.hydroDamControllerBlock,
200,
30);
int multiplier = material.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1
: material.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;

for (int tierId = 0; tierId < HE.hydroPumpBlocks.length; tierId++) {
if (HEConfig.enabledTiers[tierId]) {
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { hulls[tierId].get(1L),
GT_OreDictUnificator
.get(OrePrefixes.rotor, rotorMaterialsPerVoltage[tierId], 2L),
motors[tierId].get(1L), pumps[tierId].get(1L),
GT_OreDictUnificator
.get(OrePrefixes.cableGt01, cableMaterialsPerVoltage[tierId], 2L),
GT_Utility.getIntegratedCircuit(1) },
material.getMolten(144L * multiplier / 2L),
HE.hydroPumpBlocks[tierId],
200,
(int) (GT_Values.V[tierId] >> 2));
GT_Values.RA.stdBuilder()
.itemInputs(
ItemList.Casing_SolidSteel.get(1L),
new ItemStack(GregTech_API.sBlockConcretes, 2, 8),
ItemList.Cover_Screen.get(1L),
ItemList.FluidRegulator_MV.get(2L),
GT_Utility.getIntegratedCircuit(1))
.itemOutputs(HE.hydroDamControllerBlock).fluidInputs(material.getMolten(144L * multiplier / 2L))
.duration(10 * SECONDS).eut(TierEU.RECIPE_LV).addTo(assemblerRecipes);

GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { hulls[tierId].get(1L),
GT_OreDictUnificator
.get(OrePrefixes.rotor, rotorMaterialsPerVoltage[tierId], 2L),
motors[tierId].get(1L), pumps[tierId].get(1L),
GT_OreDictUnificator
.get(OrePrefixes.cableGt01, cableMaterialsPerVoltage[tierId], 2L),
GT_Utility.getIntegratedCircuit(2) },
material.getMolten(144L * multiplier / 2L),
HE.hydroTurbineBlocks[tierId],
200,
(int) (GT_Values.V[tierId] >> 2));
}
for (int tierId = 0; tierId < HE.hydroPumpBlocks.length; tierId++) {
if (!(HEConfig.enabledTiers[tierId])) {
continue;
}

GT_Values.RA.stdBuilder()
.itemInputs(
hulls[tierId].get(1L),
GT_OreDictUnificator.get(OrePrefixes.rotor, rotorMaterialsPerVoltage[tierId], 2L),
motors[tierId].get(1L),
pumps[tierId].get(1L),
GT_OreDictUnificator.get(OrePrefixes.cableGt01, cableMaterialsPerVoltage[tierId], 2L),
GT_Utility.getIntegratedCircuit(1))
.itemOutputs(HE.hydroPumpBlocks[tierId]).fluidInputs(material.getMolten(144L * multiplier / 2L))
.duration(10 * SECONDS).eut(GT_Values.V[tierId - 1]).addTo(assemblerRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(
hulls[tierId].get(1L),
GT_OreDictUnificator.get(OrePrefixes.rotor, rotorMaterialsPerVoltage[tierId], 2L),
motors[tierId].get(1L),
pumps[tierId].get(1L),
GT_OreDictUnificator.get(OrePrefixes.cableGt01, cableMaterialsPerVoltage[tierId], 2L),
GT_Utility.getIntegratedCircuit(2))
.itemOutputs(HE.hydroTurbineBlocks[tierId])
.fluidInputs(material.getMolten(144L * multiplier / 2L)).duration(10 * SECONDS)
.eut(GT_Values.V[tierId - 1]).addTo(assemblerRecipes);

}

}
}
}

0 comments on commit 702bc70

Please sign in to comment.