aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/goodgenerator/blocks/tileEntity/base
diff options
context:
space:
mode:
authorYang Xizhi <60341015+GlodBlock@users.noreply.github.com>2022-12-01 00:46:46 +0800
committerGitHub <noreply@github.com>2022-11-30 17:46:46 +0100
commit6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39 (patch)
tree938023411758f9ff49d43cfeec8ca271da9a374c /src/main/java/goodgenerator/blocks/tileEntity/base
parentf985e28ae553428945f3ce3841ac036c98266128 (diff)
downloadGT5-Unofficial-6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39.tar.gz
GT5-Unofficial-6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39.tar.bz2
GT5-Unofficial-6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39.zip
clean the long power use base and add item util for tiered material (#108)
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity/base')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LongPowerUsageBase.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LongPowerUsageBase.java b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LongPowerUsageBase.java
index b6e8f79ca8..79020d406a 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LongPowerUsageBase.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LongPowerUsageBase.java
@@ -49,7 +49,24 @@ public abstract class GT_MetaTileEntity_LongPowerUsageBase<T extends GT_MetaTile
return getInfoDataArray(this);
}
- protected abstract long getRealVoltage();
+ protected long getRealVoltage() {
+ long rEnergy = 0;
+ if (mEnergyHatches.size() == 1 && mExoticEnergyHatches.isEmpty()) {
+ // it works like most of the gt multies
+ return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage();
+ }
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rEnergy += tHatch.maxEUInput() * tHatch.maxAmperesIn();
+ }
+ }
+ for (GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rEnergy += tHatch.maxEUInput() * ((GT_MetaTileEntity_Hatch_EnergyMulti) tHatch).Amperes;
+ }
+ }
+ return rEnergy;
+ }
protected long getMaxInputAmps() {
long rAmps = 0;