aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2023-01-27 11:17:17 +0100
committerGitHub <noreply@github.com>2023-01-27 10:17:17 +0000
commit09ebf8a3deb8e2cfb7efce1fefed63c445b78bf1 (patch)
treec153269e92ce51a0205b3ca496cce15c5d1fce16
parent6d79791abb04d6f47f79b1e01e253cf71bfb4a04 (diff)
downloadGT5-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.java2
-rw-r--r--src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java6
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) {