aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base
diff options
context:
space:
mode:
authorDavid Vierra <codewarrior@hawaii.rr.com>2018-01-28 22:58:07 -1000
committerAlkalus <draknyte1@hotmail.com>2018-01-29 18:58:07 +1000
commit59e1e8f3b2538338661ff80add192016b40fb900 (patch)
treefd76dd0aba474478d0e15156b406c1106558f2bd /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base
parent0828168a736692402bd621b984c2d35590ed9730 (diff)
downloadGT5-Unofficial-59e1e8f3b2538338661ff80add192016b40fb900.tar.gz
GT5-Unofficial-59e1e8f3b2538338661ff80add192016b40fb900.tar.bz2
GT5-Unofficial-59e1e8f3b2538338661ff80add192016b40fb900.zip
Fix broken multiblocks - remove hacky `polluteEnvironment()` (#191)
This code path should never have worked. `getDeclaredField()` only searches the given class and not any of its superclasses - because `mPollution` is declared in a superclass, `null` will always be returned.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java57
1 files changed, 0 insertions, 57 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 4e353003f4..3a79b2a446 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
@@ -421,61 +421,4 @@ GT_MetaTileEntity_MultiBlockBase {
return 0;
}
- public boolean polluteEnvironment(int aPollutionLevel) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- try {
- Integer mPollution = 0;
- Field f = ReflectionUtils.getField(this.getClass(), "mPollution");
- if (f != null){
- try {
- mPollution = (Integer) f.get(this);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
- }
- if (f != null){
- try {
- if (mPollution != null){
- //Reflectively set the pollution back to the TE
- int temp = (mPollution += aPollutionLevel);
- f.set(this, temp);
- Logger.REFLECTION("Set pollution to "+temp+", it was "+mPollution+" before.");
-
- //Iterate Mufflers
- for (final GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- if (mPollution < 10000) {
- break;
- }
- if (!polluteEnvironmentHatch(tHatch)) {
- continue;
- }
- mPollution -= 10000;
- }
- }
- return mPollution < 10000;
-
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
- }
- }
- catch (Throwable t){}
- }
- return false;
- }
-
- public boolean polluteEnvironmentHatch(GT_MetaTileEntity_Hatch_Muffler tHatch) {
- if (tHatch.getBaseMetaTileEntity().getAirAtSide(tHatch.getBaseMetaTileEntity().getFrontFacing())) {
- Logger.REFLECTION("doing pollution");
- PollutionUtils.addPollution(tHatch.getBaseMetaTileEntity(), calculatePollutionReduction(tHatch, 10000));
- return true;
- } else {
- return false;
- }
- }
-
- public int calculatePollutionReduction(GT_MetaTileEntity_Hatch_Muffler tHatch, int aPollution) {
- return (int) ((double) aPollution * Math.pow(0.7D, (double) (tHatch.mTier - 1)));
- }
-
}