From 12226854a260d3f0328b8724b24db05243b790de Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Fri, 27 Sep 2024 18:21:33 -0400 Subject: [PATCH] Fix large essentia smelter EU usage --- .../tileEntity/MTELargeEssentiaSmeltery.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java index 40f01fbde4e..43d066d5b53 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java @@ -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; @@ -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; }