diff options
author | Jakub <53441451+kuba6000@users.noreply.github.com> | 2023-01-27 11:17:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 10:17:17 +0000 |
commit | 09ebf8a3deb8e2cfb7efce1fefed63c445b78bf1 (patch) | |
tree | c153269e92ce51a0205b3ca496cce15c5d1fce16 | |
parent | 6d79791abb04d6f47f79b1e01e253cf71bfb4a04 (diff) | |
download | GT5-Unofficial-09ebf8a3deb8e2cfb7efce1fefed63c445b78bf1.tar.gz GT5-Unofficial-09ebf8a3deb8e2cfb7efce1fefed63c445b78bf1.tar.bz2 GT5-Unofficial-09ebf8a3deb8e2cfb7efce1fefed63c445b78bf1.zip |
Fix total EU implementation (PCB Factory and Nano Forge overclocking fix) (#1693)
* Fix total EU implementation
* Wrong hatches
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java index 955872e596..feba14b10d 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java @@ -184,7 +184,7 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase< } public long getMaxInputEu() { - return getMaxInputVoltage() * getMaxInputAmps(); + return GT_ExoticEnergyInputHelper.getTotalEuMulti(getExoticAndNormalEnergyHatchList()); } @Override diff --git a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java index 820ec07487..3f57cf758b 100644 --- a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java +++ b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java @@ -58,7 +58,11 @@ public class GT_ExoticEnergyInputHelper { } public static long getTotalEuMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) { - return getMaxWorkingInputAmpsMulti(hatches) * getAverageInputVoltageMulti(hatches); + long rEU = 0L; + for (GT_MetaTileEntity_Hatch tHatch : hatches) + if (isValidMetaTileEntity(tHatch)) + rEU += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.maxWorkingAmperesIn(); + return rEU; } public static long getMaxInputVoltageMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) { |