Skip to content

Commit

Permalink
Cleanup isValidMetaTileEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune committed Oct 30, 2023
1 parent 5442ad6 commit 5cc2196
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.gradle
.settings
/.idea/
/.vscode/
/run/
/build/
/eclipse/
Expand All @@ -25,7 +26,13 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
src/main/resources/mixins.*([!.]).json
*.bat
.vscode
*.bak
*.DS_Store
!gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static gregtech.api.enums.GT_Values.*;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static gregtech.api.util.GT_Utility.filterValidMTEs;
import static java.lang.Math.max;
import static java.lang.Math.min;

Expand Down Expand Up @@ -260,11 +261,9 @@ public int getPollutionCleaningRatePerSecond(float turbineEff, float multiEff, b
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) max(1, GT_Utility.getTier(tVoltage));
int pollutionPerSecond = 0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
// applying scaling factor
pollutionPerSecond += (int) Math.pow(MainRegistry.CoreConfig.scalingFactor, min(tTier, tHatch.mTier));
}
for (GT_MetaTileEntity_Hatch_Muffler tHatch : filterValidMTEs(mMufflerHatches)) {
// applying scaling factor
pollutionPerSecond += (int) Math.pow(MainRegistry.CoreConfig.scalingFactor, min(tTier, tHatch.mTier));
}
// apply the boost
if (isRateBoosted) {
Expand Down

0 comments on commit 5cc2196

Please sign in to comment.