From 8fcd62bd952c6bfa8896fe08e06df514a2b6f9ce Mon Sep 17 00:00:00 2001 From: BlueWeabo Date: Wed, 2 Aug 2023 19:25:29 +0300 Subject: [PATCH] Fix TT extended Multis using wrong exotic energy input hatches list (#237) * fix TT extended Multis using wrong exotic energy input hatches list * go away from using stream and use addAll --- .../GT_MetaTileEntity_MultiblockBase_EM.java | 73 ++++++++----------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 82670742a..fa8b81966 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -1989,56 +1989,28 @@ public final boolean overclockAndPutValuesIn_EM(long EU, int time) { // TODO rev return true; } // Use in EM check recipe return statement if you want overclocking - @Override // same as gt sum of all hatches - public long getMaxInputVoltage() { - return getMaxInputVoltageSum(); - } - - // same as gt sum of all hatches + /** + * Use {@link #getMaxInputVoltage()} + */ + @Deprecated public final long getMaxInputVoltageSum() { - long rVoltage = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.maxEUInput(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.maxEUInput(); - } - } - return rVoltage; + return getMaxInputVoltage(); } - // new Method + /** + * Use {@link #getMaxInputEu()} + */ + @Deprecated public final long getMaxInputEnergy() { - long energy = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - energy += tHatch.maxEUInput() * tHatch.maxAmperesIn(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - energy += tHatch.maxEUInput() * tHatch.maxAmperesIn(); - } - } - return energy; + return getMaxInputEu(); } + /** + * Use {@link #getMaxInputEu()} + */ + @Deprecated public final long getMaxInputEnergy_EM() { - long energy = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - energy += tHatch.maxEUInput(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - energy += tHatch.maxEUInput() * tHatch.Amperes; - } - } - return energy; + return getMaxInputEu(); } // new Method @@ -2055,6 +2027,21 @@ public final long getMaxAmpereFlowAtMinTierOfEnergyHatches() { return eAmpereFlow; } + @Override + public List getExoticAndNormalEnergyHatchList() { + List list = new ArrayList<>(); + list.addAll(mEnergyHatches); + list.addAll(eEnergyMulti); + return list; + } + + @Override + public List getExoticEnergyHatches() { + List list = new ArrayList<>(); + list.addAll(eEnergyMulti); + return list; + } + // endregion // region convenience copies input and output EM