diff options
author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-09-15 23:30:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-15 23:30:13 +0200 |
commit | 5f6011f705c75007b48735d02e590581c78ca8db (patch) | |
tree | 9b7f240e568d11c2396dc1e8b9997bbdf61c83ca /src/main/java/goodgenerator/blocks/tileEntity | |
parent | dda786c0183f6655a4a264edf2d75688e7fe895e (diff) | |
download | GT5-Unofficial-5f6011f705c75007b48735d02e590581c78ca8db.tar.gz GT5-Unofficial-5f6011f705c75007b48735d02e590581c78ca8db.tar.bz2 GT5-Unofficial-5f6011f705c75007b48735d02e590581c78ca8db.zip |
Small optimizations & MultiBlockBase cleanup (#3197)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity')
4 files changed, 19 insertions, 19 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTECoolantTower.java b/src/main/java/goodgenerator/blocks/tileEntity/MTECoolantTower.java index be0fe5b4ce..b9c03aef0c 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTECoolantTower.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTECoolantTower.java @@ -4,7 +4,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static goodgenerator.util.DescTextLocalization.BLUE_PRINT_INFO; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GTStructureUtility.*; -import static gregtech.api.util.GTUtility.filterValidMTEs; +import static gregtech.api.util.GTUtility.validMTEList; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -148,7 +148,7 @@ public class MTECoolantTower extends MTETooltipMultiBlockBaseEM implements ICons this.mMaxProgresstime = 20; int steam = 0; - for (MTEHatchInput tHatch : filterValidMTEs(mInputHatches)) { + for (MTEHatchInput tHatch : validMTEList(mInputHatches)) { steam += maybeDrainHatch(tHatch); } addOutput(GTModHandler.getDistilledWater(steam / 160)); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java index d268db2f35..0c66084592 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java @@ -7,7 +7,7 @@ import static goodgenerator.util.DescTextLocalization.BLUE_PRINT_INFO; import static gregtech.api.enums.HatchElement.*; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.util.GTStructureUtility.ofFrame; -import static gregtech.api.util.GTUtility.filterValidMTEs; +import static gregtech.api.util.GTUtility.validMTEList; import java.util.Arrays; import java.util.Collection; @@ -389,10 +389,10 @@ public class MTEPreciseAssembler extends MTEExtendedPowerMultiBlockBase<MTEPreci private int checkEnergyHatchTier() { int tier = 0; - for (MTEHatchEnergy tHatch : filterValidMTEs(mEnergyHatches)) { + for (MTEHatchEnergy tHatch : validMTEList(mEnergyHatches)) { tier = Math.max(tHatch.mTier, tier); } - for (MTEHatch tHatch : filterValidMTEs(mExoticEnergyHatches)) { + for (MTEHatch tHatch : validMTEList(mExoticEnergyHatches)) { tier = Math.max(tHatch.mTier, tier); } return tier; @@ -420,28 +420,28 @@ public class MTEPreciseAssembler extends MTEExtendedPowerMultiBlockBase<MTEPreci hatch.updateTexture(texture); } } - for (MTEHatch hatch : filterValidMTEs(mInputHatches)) { + for (MTEHatch hatch : validMTEList(mInputHatches)) { hatch.updateTexture(texture); } - for (MTEHatch hatch : filterValidMTEs(mInputBusses)) { + for (MTEHatch hatch : validMTEList(mInputBusses)) { hatch.updateTexture(texture); } - for (MTEHatch hatch : filterValidMTEs(mOutputHatches)) { + for (MTEHatch hatch : validMTEList(mOutputHatches)) { hatch.updateTexture(texture); } - for (MTEHatch hatch : filterValidMTEs(mOutputBusses)) { + for (MTEHatch hatch : validMTEList(mOutputBusses)) { hatch.updateTexture(texture); } - for (MTEHatch hatch : filterValidMTEs(mEnergyHatches)) { + for (MTEHatch hatch : validMTEList(mEnergyHatches)) { hatch.updateTexture(texture); } - for (MTEHatch hatch : filterValidMTEs(mMaintenanceHatches)) { + for (MTEHatch hatch : validMTEList(mMaintenanceHatches)) { hatch.updateTexture(texture); } - for (MTEHatch hatch : filterValidMTEs(mMufflerHatches)) { + for (MTEHatch hatch : validMTEList(mMufflerHatches)) { hatch.updateTexture(texture); } - for (MTEHatch hatch : filterValidMTEs(mExoticEnergyHatches)) { + for (MTEHatch hatch : validMTEList(mExoticEnergyHatches)) { hatch.updateTexture(texture); } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java index b14395dc20..d07597418f 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java @@ -5,7 +5,7 @@ import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import static gregtech.api.util.GTStructureUtility.filterByMTETier; import static gregtech.api.util.GTStructureUtility.ofFrame; -import static gregtech.api.util.GTUtility.filterValidMTEs; +import static gregtech.api.util.GTUtility.validMTEList; import java.util.List; @@ -300,7 +300,7 @@ public abstract class MTELargeFusionComputer extends MTETooltipMultiBlockBaseEM long energyLimit = getSingleHatchPower(); List<MTEHatch> hatches = getExoticAndNormalEnergyHatchList(); - for (MTEHatch hatch : filterValidMTEs(hatches)) { + for (MTEHatch hatch : validMTEList(hatches)) { long consumableEnergy = Math.min(hatch.getEUVar(), energyLimit); long receivedEnergy = Math .min(consumableEnergy, maxEUStore() - aBaseMetaTileEntity.getStoredEU()); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java index ea36b53651..7b06dbb96d 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java @@ -7,7 +7,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.HatchElement.*; import static gregtech.api.util.GTStructureUtility.*; -import static gregtech.api.util.GTUtility.filterValidMTEs; +import static gregtech.api.util.GTUtility.validMTEList; import java.util.ArrayList; @@ -229,7 +229,7 @@ public abstract class MTELargeTurbineBase extends MTEEnhancedMultiBlockBase<MTEL public long getMaximumOutput() { long aTotal = 0; - for (MTEHatchDynamo aDynamo : filterValidMTEs(mDynamoHatches)) { + for (MTEHatchDynamo aDynamo : validMTEList(mDynamoHatches)) { long aVoltage = aDynamo.maxEUOutput(); aTotal = aDynamo.maxAmperesOut() * aVoltage; break; @@ -240,7 +240,7 @@ public abstract class MTELargeTurbineBase extends MTEEnhancedMultiBlockBase<MTEL @Override public String[] getInfoData() { int mPollutionReduction = 0; - for (MTEHatchMuffler tHatch : filterValidMTEs(mMufflerHatches)) { + for (MTEHatchMuffler tHatch : validMTEList(mMufflerHatches)) { mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } @@ -264,7 +264,7 @@ public abstract class MTELargeTurbineBase extends MTEEnhancedMultiBlockBase<MTEL long storedEnergy = 0; long maxEnergy = 0; - for (MTEHatchDynamo tHatch : filterValidMTEs(mDynamoHatches)) { + for (MTEHatchDynamo tHatch : validMTEList(mDynamoHatches)) { storedEnergy += tHatch.getBaseMetaTileEntity() .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() |