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

add amps in hatch in one go #851

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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