1414import com .gregtechceu .gtceu .api .machine .multiblock .WorkableMultiblockMachine ;
1515import com .gregtechceu .gtceu .api .recipe .GTRecipe ;
1616import com .gregtechceu .gtceu .api .recipe .RecipeHelper ;
17+ import com .gregtechceu .gtceu .api .recipe .content .ContentModifier ;
1718import com .gregtechceu .gtceu .api .recipe .logic .OCParams ;
1819import com .gregtechceu .gtceu .api .recipe .logic .OCResult ;
1920import com .gregtechceu .gtceu .common .data .GTMaterials ;
3334
3435import com .google .common .primitives .Ints ;
3536import lombok .Getter ;
36- import lombok .val ;
3737import org .jetbrains .annotations .NotNull ;
3838import org .jetbrains .annotations .Nullable ;
3939
@@ -54,15 +54,16 @@ public class LargeCombustionEngineMachine extends WorkableElectricMultiblockMach
5454 protected static final ManagedFieldHolder MANAGED_FIELD_HOLDER = new ManagedFieldHolder (
5555 LargeCombustionEngineMachine .class , WorkableMultiblockMachine .MANAGED_FIELD_HOLDER );
5656
57- private static final FluidStack OXYGEN_STACK = GTMaterials .Oxygen .getFluid (20 );
58- private static final FluidStack LIQUID_OXYGEN_STACK = GTMaterials .Oxygen .getFluid (FluidStorageKeys .LIQUID , 80 );
57+ private static final FluidStack OXYGEN_STACK = GTMaterials .Oxygen .getFluid (1 );
58+ private static final FluidStack LIQUID_OXYGEN_STACK = GTMaterials .Oxygen .getFluid (FluidStorageKeys .LIQUID , 4 );
5959 private static final FluidStack LUBRICANT_STACK = GTMaterials .Lubricant .getFluid (1 );
6060
6161 @ Getter
6262 private final int tier ;
6363 // runtime
6464 @ DescSynced
6565 private boolean isOxygenBoosted = false ;
66+ private int runningTimer = 0 ;
6667
6768 public LargeCombustionEngineMachine (IMachineBlockEntity holder , int tier ) {
6869 super (holder );
@@ -131,6 +132,14 @@ public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe rec
131132 } else {
132133 eut = EUt * parallelResult .getSecond ();
133134 }
135+
136+ recipe = new GTRecipe (recipe .recipeType , recipe .id ,
137+ recipe .copyContents (recipe .inputs , ContentModifier .multiplier (parallelResult .getSecond ())),
138+ recipe .copyContents (recipe .outputs , ContentModifier .multiplier (parallelResult .getSecond ())),
139+ recipe .tickInputs , recipe .tickOutputs , recipe .inputChanceLogics , recipe .outputChanceLogics ,
140+ recipe .tickInputChanceLogics , recipe .tickOutputChanceLogics , recipe .conditions ,
141+ recipe .ingredientActions , recipe .data , recipe .duration , recipe .isFuel , recipe .recipeCategory );
142+
134143 result .init (-eut , recipe .duration , 1 , params .getOcAmount ());
135144 return recipe ;
136145 }
@@ -142,20 +151,24 @@ public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe rec
142151 public boolean onWorking () {
143152 boolean value = super .onWorking ();
144153 // check lubricant
145- val totalContinuousRunningTime = recipeLogic . getTotalContinuousRunningTime ();
146- if (( totalContinuousRunningTime == 1 || totalContinuousRunningTime % 72 == 0 ) ) {
154+
155+ if (runningTimer % 72 == 0 ) {
147156 // insufficient lubricant
148157 if (!getLubricantRecipe ().handleRecipeIO (IO .IN , this , this .recipeLogic .getChanceCaches ())) {
149158 recipeLogic .interruptRecipe ();
150159 return false ;
151160 }
152161 }
153162 // check boost fluid
154- if (( totalContinuousRunningTime == 1 || totalContinuousRunningTime % 20 == 0 ) && isBoostAllowed ()) {
163+ if (isBoostAllowed ()) {
155164 var boosterRecipe = getBoostRecipe ();
156165 this .isOxygenBoosted = boosterRecipe .matchRecipe (this ).isSuccess () &&
157166 boosterRecipe .handleRecipeIO (IO .IN , this , this .recipeLogic .getChanceCaches ());
158167 }
168+
169+ runningTimer ++;
170+ if (runningTimer > 72000 ) runningTimer %= 72000 ; // reset once every hour of running
171+
159172 return value ;
160173 }
161174
0 commit comments