Skip to content

Commit

Permalink
update alloy blast recipe generation for freezer recipe changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 committed Nov 26, 2023
1 parent ed44209 commit 098d1c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@

* Added compat for GTCEu 2.8
* Limited multiblock Assembler and Circuit Assembler to 1 energy hatch
* Updated molten fluid cooling recipes to respect freezer energy and duration overrides
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package gregicality.multiblocks.api.recipes.alloyblast;

import static gregtech.api.GTValues.MV;
import static gregtech.api.GTValues.VA;

import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;

Expand Down Expand Up @@ -57,7 +60,7 @@ public void produce(@NotNull Material material, @NotNull BlastProperty blastProp
// if the material does not need a vacuum freezer, exit
if (!OrePrefix.ingotHot.doGenerateItem(material)) return;

addFreezerRecipes(material, molten, blastProperty.getBlastTemperature());
addFreezerRecipes(material, molten, blastProperty);
}

/**
Expand Down Expand Up @@ -162,21 +165,27 @@ protected int getGasCircuitNum(int componentAmount) {
/**
* Add the freezer recipes for the material
*
* @param material the material to generate for
* @param molten the molten fluid
* @param temperature the temperature of the material
* @param material the material to generate for
* @param molten the molten fluid
* @param property the blast property of the material
*/
@SuppressWarnings("MethodMayBeStatic")
protected void addFreezerRecipes(@NotNull Material material, @NotNull Fluid molten, int temperature) {
protected void addFreezerRecipes(@NotNull Material material, @NotNull Fluid molten,
@NotNull BlastProperty property) {
int vacuumDuration = property.getVacuumDurationOverride() == -1 ? (int) material.getMass() * 3 :
property.getVacuumDurationOverride();
int vacuumEUt = property.getVacuumEUtOverride() == -1 ? VA[MV] : property.getVacuumEUtOverride();

// build the freezer recipe
RecipeBuilder<?> freezerBuilder = RecipeMaps.VACUUM_RECIPES.recipeBuilder()
.fluidInputs(new FluidStack(molten, GTValues.L))
.duration((int) material.getMass() * 3)
.notConsumable(MetaItems.SHAPE_MOLD_INGOT.getStackForm())
.output(OrePrefix.ingot, material);
.output(OrePrefix.ingot, material)
.duration(vacuumDuration)
.EUt(vacuumEUt);

// helium for when >= 5000K temperature
if (temperature >= 5000) {
if (property.getBlastTemperature() >= 5000) {
freezerBuilder.fluidInputs(Materials.Helium.getFluid(FluidStorageKeys.LIQUID, 500))
.fluidOutputs(Materials.Helium.getFluid(250));
}
Expand Down

0 comments on commit 098d1c9

Please sign in to comment.