aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 81f6e9281b..bb822ec816 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -185,7 +185,7 @@ GT_MetaTileEntity_MultiBlockBase {
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
- mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction);
+ mPollutionReduction=Math.max(calculatePollutionReductionForHatch(tHatch, 100),mPollutionReduction);
}
}
@@ -1252,6 +1252,22 @@ GT_MetaTileEntity_MultiBlockBase {
return "";
}
}
+
+ private static Method calculatePollutionReduction;
+ public int calculatePollutionReductionForHatch(GT_MetaTileEntity_Hatch_Muffler i , int g) {
+ if (calculatePollutionReduction == null) {
+ try {
+ calculatePollutionReduction = i.getClass().getDeclaredMethod("calculatePollutionReduction", int.class);
+ } catch (NoSuchMethodException | SecurityException e) {
+ calculatePollutionReduction = null;
+ }
+ }
+ try {
+ return (int) calculatePollutionReduction.invoke(i, g);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return 0;
+ }
+ }
@Override
public void saveNBTData(NBTTagCompound aNBT) {