Skip to content

Commit

Permalink
Fix large essentia smelter EU usage (#3292)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
RecursivePineapple and Dream-Master committed Sep 28, 2024
1 parent 6a12f69 commit 254a3bc
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import gregtech.api.recipe.check.SimpleCheckRecipeResult;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.OverclockCalculator;
import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyMulti;
import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase;
import thaumcraft.api.aspects.Aspect;
Expand Down Expand Up @@ -363,14 +364,18 @@ protected void runMachine(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
this.drainNodePower(WORLD, x, y, z);
this.nodePower -= expectedPower();

calculatePerfectOverclockedNessMulti(
RECIPE_EUT,
(int) Math.ceil(this.mOutputAspects.visSize() * RECIPE_DURATION * (1 - this.nodeIncrease * 0.005)),
1,
Math.min(Integer.MAX_VALUE, getMaxInputEnergy_EM()));
OverclockCalculator calculator = new OverclockCalculator().setRecipeEUt(RECIPE_EUT)
.setEUt(getMaxInputEu())
.setDuration(
(int) Math.ceil(this.mOutputAspects.visSize() * RECIPE_DURATION * (1 - this.nodeIncrease * 0.005)))
.setDurationDecreasePerOC(4)
.calculate();

useLongPower = true;
lEUt = -calculator.getConsumption();
mMaxProgresstime = calculator.getDuration();

this.updateSlots();
if (this.mEUt > 0) this.mEUt = -this.mEUt;
return CheckRecipeResultRegistry.SUCCESSFUL;
}

Expand Down

0 comments on commit 254a3bc

Please sign in to comment.