Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
add amps in hatch in one go (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
boubou19 committed Mar 17, 2024
1 parent 71cbfcd commit 94a08e8
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 94a08e8

Please sign in to comment.