aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorBlood-Asp <bloodasphendrik@gmail.com>2016-10-25 20:22:56 +0200
committerTechnus <daniel112092@gmail.com>2016-10-25 21:31:51 +0200
commitb476b0d54ac09d027af8a2f7f4a5735fb2f83e5f (patch)
treed11420c8717ee09effbfc2338c41a8625a26dd46 /src/main/java/gregtech/api/metatileentity/implementations
parent894a79153ce8294b41514007641cd4963b789c47 (diff)
downloadGT5-Unofficial-b476b0d54ac09d027af8a2f7f4a5735fb2f83e5f.tar.gz
GT5-Unofficial-b476b0d54ac09d027af8a2f7f4a5735fb2f83e5f.tar.bz2
GT5-Unofficial-b476b0d54ac09d027af8a2f7f4a5735fb2f83e5f.zip
Initial port of pollution changes from bloodasp
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java2
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java19
2 files changed, 7 insertions, 14 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
index c583187c6f..99f3612e7e 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
@@ -210,7 +210,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
}
if(tProducedEU>0&&getPollution()>0){
GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()),
- (int) ((tProducedEU * getPollution()/500)+1));
+ (int) ((tProducedEU * getPollution()/(500*mTier))+1));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
index f30588876d..5272a53ca1 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
@@ -25,7 +25,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
@Override
public String[] getDescription() {
- return new String[]{mDescription, "DO NOT OBSTRUCT THE OUTPUT!"};
+ return new String[]{mDescription, "DO NOT OBSTRUCT THE OUTPUT!","Reduces Pollution to "+calculatePollutionReduction(100)+"%"};
}
@Override
@@ -64,9 +64,13 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
}
public boolean polluteEnvironment() {
- GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 10000 - (600*(mTier-1)));
+ GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), calculatePollutionReduction(10000));
return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing());
}
+
+ public int calculatePollutionReduction(int aPollution){
+ return (int) (aPollution *(Math.pow(0.5, mTier-1)));
+ }
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
@@ -78,17 +82,6 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
return false;
}
- //@Override
- //public String[] getInfoData() {
- // return new String[]{
- // "Reduces pollution by: "+ EnumChatFormatting.GREEN + (6*(mTier-1))+ EnumChatFormatting.RESET+" %"
- // };
- //}
-
- public int getPollutionReduction() {
- return 6*(mTier-1);
- }
-
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);