Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup isValidMetaTileEntity #749

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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