aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2016-10-25 22:04:14 +0200
committerTechnus <daniel112092@gmail.com>2016-10-25 22:04:14 +0200
commit299c54f6b2fb41dc816e388cf8ca0c39efec17cf (patch)
tree90b8ff4b96ecccb80f7e326acb5f3c279052ce66 /src/main/java/gregtech/api/metatileentity/implementations
parentb476b0d54ac09d027af8a2f7f4a5735fb2f83e5f (diff)
downloadGT5-Unofficial-299c54f6b2fb41dc816e388cf8ca0c39efec17cf.tar.gz
GT5-Unofficial-299c54f6b2fb41dc816e388cf8ca0c39efec17cf.tar.bz2
GT5-Unofficial-299c54f6b2fb41dc816e388cf8ca0c39efec17cf.zip
Things and stuff about pollution
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java13
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java4
2 files changed, 9 insertions, 8 deletions
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 5272a53ca1..25b620d6ef 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
@@ -69,7 +69,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
}
public int calculatePollutionReduction(int aPollution){
- return (int) (aPollution *(Math.pow(0.5, mTier-1)));
+ return (int) (aPollution *(Math.pow(0.8, mTier-1)));
}
@Override
@@ -95,11 +95,12 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
double xPos=aDir.offsetX+aMuffler.getXCoord()+0.25F;
double yPos=aDir.offsetX+aMuffler.getYCoord()+0.05F;
double zPos=aDir.offsetX+aMuffler.getZCoord()+0.25F;
-
- aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos, zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.3D, 0.0D);
- if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>= GT_Mod.gregtechproxy.mPollutionSmogLimit) {
- aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos, zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.45D, 0.0D);
- aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos, zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.6D, 0.0D);
+ if((new XSTR()).nextFloat()*100<calculatePollutionReduction(100)){
+ aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos, zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.3D, 0.0D);
+ if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>= GT_Mod.gregtechproxy.mPollutionSmogLimit) {
+ aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos, zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.45D, 0.0D);
+ aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos, zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.6D, 0.0D);
+ }
}
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
index 97cbe95255..8be2c95aec 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
@@ -846,7 +846,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
- mPollutionReduction+=tHatch.getPollutionReduction();
+ mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction);
}
}
@@ -865,7 +865,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+
" Efficiency: "+
EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %",
- "Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"
+ "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"
};
}