From 97cafed13b0e1223fdecc3bd29df43ed1beafb2b Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 20:14:14 +0200 Subject: [PATCH] Numbers Crunched For Simulated Pollution --- .../GT_MetaTileEntity_Hatch_Muffler.java | 2 +- src/main/java/gregtech/common/GT_Pollution.java | 14 +++++++------- src/main/java/gregtech/common/GT_Proxy.java | 8 ++++---- 3 files changed, 12 insertions(+), 12 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 cf7378e8..b8ec41ec 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 @@ -60,7 +60,7 @@ 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()), 1000 - (60*mTier)); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 10000 - (600*mTier)); return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing()); } diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index db9c201d..19853347 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -41,10 +41,10 @@ public class GT_Pollution { // System.out.println("process: "+tPos.chunkPosX+" "+tPos.chunkPosZ+" "+tPollution); //Reduce pollution in chunk //tPollution = (int)(0.99f*tPollution); - tPollution -= 1000; + tPollution -= 3000; if(tPollution<=0){tPollution = 0;}else{ //Spread Pollution - if(tPollution>50000){ + if(tPollution>500000){ List tNeighbor = new ArrayList(); tNeighbor.add(new ChunkPosition(tPos.chunkPosX+1, 1, tPos.chunkPosZ)); tNeighbor.add(new ChunkPosition(tPos.chunkPosX-1, 1, tPos.chunkPosZ)); @@ -55,8 +55,8 @@ public class GT_Pollution { int tNPol = GT_Proxy.chunkData.get(tNPos)[1]; if(tNPol*12 < tPollution*10){ int tDiff = tPollution - tNPol; - tDiff = tDiff/10; - tNPol += tDiff; + tDiff = tDiff/20; + tNPol = GT_Utility.safeInt((long)tNPol+tDiff);//tNPol += tDiff; tPollution -= tDiff; GT_Proxy.chunkData.get(tNPos)[1] = tNPol; } @@ -74,7 +74,7 @@ public class GT_Pollution { AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX*16, 0, tPos.chunkPosZ*16, tPos.chunkPosX*16+16, 256, tPos.chunkPosZ*16+16); List tEntitys = aWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); for(EntityLiving tEnt : tEntitys){ - if(tRan.nextInt(tPollution/25000) > 20){ + if(tRan.nextInt(tPollution/25000) > 10){ tEnt.addPotionEffect(new PotionEffect(Potion.blindness.id, tPollution/25000, 1)); } } @@ -162,10 +162,10 @@ public class GT_Pollution { if(GT_Proxy.chunkData.containsKey(tPos)){ tData = GT_Proxy.chunkData.get(tPos); if(tData.length>1){ - tData[1] += aPollution; + tData[1]=GT_Utility.safeInt((long)tData[1]+aPollution);//tData[1] += aPollution; } }else{ - tData[1] += aPollution; + tData[1]=GT_Utility.safeInt((long)tData[1]+aPollution);//tData[1] += aPollution; GT_Proxy.chunkData.put(tPos, tData); } }catch(Exception e){ diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index cdef9a42..6b579729 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -166,10 +166,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mGraniteHavestLevel=3; public int mMaxHarvestLevel=7; public int mWireHeatingTicks = 4; - public int mPollutionSmogLimit = 40000; - public int mPollutionPoisonLimit = 75000; - public int mPollutionVegetationLimit = 100000; - public int mPollutionSourRainLimit = 200000; + public int mPollutionSmogLimit = 550000; + public int mPollutionPoisonLimit = 750000; + public int mPollutionVegetationLimit = 1000000; + public int mPollutionSourRainLimit = 2000000; //public double mMagneticraftBonusOutputPercent = 100.0d; private World mUniverse = null; private final String aTextThermalExpansion = "ThermalExpansion";