From a74910f531747d95a1851915d1592c030eed9d8c Mon Sep 17 00:00:00 2001 From: boubou19 Date: Sun, 17 Mar 2024 02:00:51 +0100 Subject: [PATCH] add amps in hatch in one go --- .../GregtechMetaTileEntity_LargerTurbineBase.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java index f84cc77d4..92995a831 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java @@ -840,10 +840,12 @@ public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVolta aAmpsToInject = (int) (leftToInject / aVoltage); aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage)); ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); - for (int i = 0; i < ampsOnCurrentHatch; i++) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); - } + + // add full amps + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage * ampsOnCurrentHatch, false); injected += aVoltage * ampsOnCurrentHatch; + + // add reminder if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); injected += aRemainder;