From 1ca8ccaa9a7f6f37c16e8be0139d7c04521b979b Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:01:40 -0600 Subject: [PATCH] make sure boilers and primitive machines work (#1883) Co-authored-by: YoungOnionMC --- .../gtceu/api/machine/steam/SteamBoilerMachine.java | 3 +-- .../gtceu/api/recipe/modifier/RecipeModifierList.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java b/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java index 7082636dfa..a4aa9798ec 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/steam/SteamBoilerMachine.java @@ -12,7 +12,6 @@ import com.gregtechceu.gtceu.api.machine.feature.IUIMachine; import com.gregtechceu.gtceu.api.machine.trait.NotifiableFluidTank; import com.gregtechceu.gtceu.api.recipe.GTRecipe; -import com.gregtechceu.gtceu.api.recipe.RecipeHelper; import com.gregtechceu.gtceu.api.recipe.logic.OCParams; import com.gregtechceu.gtceu.api.recipe.logic.OCResult; import com.gregtechceu.gtceu.common.data.GTMaterials; @@ -261,7 +260,7 @@ public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe rec @NotNull OCResult result) { if (machine instanceof SteamBoilerMachine boilerMachine) { recipe = recipe.copy(); - result.init(RecipeHelper.getInputEUt(recipe), recipe.duration); + result.init(0, recipe.duration); if (boilerMachine.isHighPressure) result.setDuration(result.getDuration() / 2); // recipe.duration *= 12; // maybe? diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java index de3ca61e6d..c986bab710 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java @@ -38,12 +38,12 @@ public GTRecipe apply(MetaMachine machine, @NotNull GTRecipe recipe, @NotNull OC } } - if (modifiedRecipe != null) { + if (modifiedRecipe != null && result.getDuration() != 0) { modifiedRecipe.duration = result.getDuration(); if (result.getEut() > 0) { modifiedRecipe.tickInputs.put(EURecipeCapability.CAP, List.of(new Content(result.getEut(), ChanceLogic.getMaxChancedValue(), ChanceLogic.getMaxChancedValue(), 0, null, null))); - } else { + } else if (result.getEut() < 0) { modifiedRecipe.tickOutputs.put(EURecipeCapability.CAP, List.of(new Content(-result.getEut(), ChanceLogic.getMaxChancedValue(), ChanceLogic.getMaxChancedValue(), 0, null, null))); }