From 05efaa691d2ebe9fd4811444dbf6f0de1ca142b6 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 13 Jan 2019 12:43:44 +0000 Subject: + Added Xp conversion brewing recipes. - Made Xp Convertor redundant. $ Hopefully fixed ExtraUtils complaining about rendering. $ Additional 5.08 support. $ Possibly fixed recipes for some items which don't display in NEI correctly. --- .../base/GregtechMeta_MultiBlockBase.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base') 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) { -- cgit