From 5cc219653a0751827f87bda49128da9c2dbdbdab Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 30 Oct 2023 23:47:42 +0900 Subject: [PATCH] Cleanup isValidMetaTileEntity --- .gitignore | 13 ++++++++++--- .../GT_MetaTileEntity_AirFilterBase.java | 9 ++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 89e03fe12..27a8ae0f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .gradle .settings /.idea/ +/.vscode/ /run/ /build/ /eclipse/ @@ -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 \ No newline at end of file diff --git a/src/main/java/com/dreammaster/gthandler/multiAirFilter/GT_MetaTileEntity_AirFilterBase.java b/src/main/java/com/dreammaster/gthandler/multiAirFilter/GT_MetaTileEntity_AirFilterBase.java index 9a5d848ae..acee388c7 100644 --- a/src/main/java/com/dreammaster/gthandler/multiAirFilter/GT_MetaTileEntity_AirFilterBase.java +++ b/src/main/java/com/dreammaster/gthandler/multiAirFilter/GT_MetaTileEntity_AirFilterBase.java @@ -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; @@ -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) {