From 24346044a1fe252e41643c80fcf05510ec7df751 Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 1 Nov 2016 20:45:28 +0100 Subject: [PATCH] MOOOOORE POLLUTION --- .../tileentity/IEnergyConnected.java | 2 +- .../api/metatileentity/MetaPipeEntity.java | 2 +- .../api/metatileentity/MetaTileEntity.java | 2 +- .../GT_MetaTileEntity_BasicGenerator.java | 2 +- .../GT_MetaTileEntity_Hatch_Muffler.java | 2 +- .../java/gregtech/common/GT_Pollution.java | 32 +++++++++++++------ .../GT_MetaTileEntity_Boiler_Bronze.java | 2 +- .../GT_MetaTileEntity_Boiler_Lava.java | 2 +- .../GT_MetaTileEntity_Boiler_Steel.java | 2 +- .../GT_MetaTileEntity_BronzeBlastFurnace.java | 2 +- .../multi/GT_MetaTileEntity_Charcoal_Pit.java | 2 +- ...T_MetaTileEntity_ElectricBlastFurnace.java | 2 +- ...GT_MetaTileEntity_ImplosionCompressor.java | 2 +- .../multi/GT_MetaTileEntity_LargeBoiler.java | 2 +- .../GT_MetaTileEntity_LargeTurbine_Gas.java | 2 +- .../multi/GT_MetaTileEntity_MultiFurnace.java | 2 +- .../multi/GT_MetaTileEntity_PyrolyseOven.java | 2 +- 17 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index ee7502a0..b35d797a 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -108,7 +108,7 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) if(GT_Mod.gregtechproxy.mPollution) - GT_Pollution.addPollution(new ChunkPosition(tX, tY, tZ), 50000); + GT_Pollution.addPollution(new ChunkPosition(tX, tY, tZ), 100000); tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); } } diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index 63b0bc99..0182052f 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -668,7 +668,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity { tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) if(GT_Mod.gregtechproxy.mPollution) - GT_Pollution.addPollution(new ChunkPosition(tX, tY, tZ), 50000); + GT_Pollution.addPollution(new ChunkPosition(tX, tY, tZ), 100000); tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 061144a7..3cc96b50 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -858,7 +858,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity { tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) if(GT_Mod.gregtechproxy.mPollution) - GT_Pollution.addPollution(new ChunkPosition(tX, tY, tZ), 50000); + GT_Pollution.addPollution(new ChunkPosition(tX, tY, tZ), 100000); tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); } 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 99f3612e..c8031b86 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*mTier))+1)); + (int) ((tProducedEU * getPollution()/(250*(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 413dff43..feb87ed3 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 @@ -72,7 +72,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public int calculatePollutionReduction(int aPollution){ - return (int) (aPollution *(Math.pow(0.8, mTier-1))); + return (int) (aPollution *(Math.pow(0.85F, mTier-1))); } @Override diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index 4bce96d7..f6a44e56 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -73,8 +73,8 @@ public class GT_Pollution { int tPollution = GT_Proxy.chunkData.get(tPos)[1]; // System.out.println("process: "+tPos.chunkPosX+" "+tPos.chunkPosZ+" "+tPollution); //Reduce pollution in chunk - tPollution = (int)(0.995f*tPollution); - tPollution -= 2000; + tPollution = (int)(0.9945f*tPollution); + //tPollution -= 2000; if(tPollution<=0){tPollution = 0;}else{ //Spread Pollution if(tPollution>400000){ @@ -108,10 +108,15 @@ public class GT_Pollution { AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX << 4, 0, tPos.chunkPosZ << 4, (tPos.chunkPosX << 4) + 16, 256, (tPos.chunkPosZ << 4) + 16); List tEntitys = aWorld.getEntitiesWithinAABB(EntityLivingBase.class, chunk); for (EntityLivingBase tEnt : tEntitys) { - if (!GT_Utility.isWearingFullGasHazmat(tEnt) && tRan.nextInt(tPollution / 25000) > 10) { - tEnt.addPotionEffect(new PotionEffect(Potion.weakness.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); - tEnt.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); - tEnt.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); + if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { + switch (tRan.nextInt(3)) { + default: + tEnt.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); + case 1: + tEnt.addPotionEffect(new PotionEffect(Potion.weakness.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); + case 2: + tEnt.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); + } } } // Poison effects @@ -119,10 +124,17 @@ 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 (EntityLivingBase tEnt : tEntitys) { - if (!GT_Utility.isWearingFullGasHazmat(tEnt) && tRan.nextInt(tPollution / 25000) > 20) { - tEnt.addPotionEffect(new PotionEffect(Potion.confusion.id, Math.min(tPollution / 2000, 1000), tPollution / 500000)); - tEnt.addPotionEffect(new PotionEffect(Potion.poison.id, Math.min(tPollution / 4000, 1000), 1)); - tEnt.addPotionEffect(new PotionEffect(Potion.blindness.id, Math.min(tPollution / 2000, 1000), 1)); + if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { + switch (tRan.nextInt(4)) { + default: + tEnt.addPotionEffect(new PotionEffect(Potion.hunger.id, tPollution / 500000)); + case 1: + tEnt.addPotionEffect(new PotionEffect(Potion.confusion.id, Math.min(tPollution / 2000, 1000), 1)); + case 2: + tEnt.addPotionEffect(new PotionEffect(Potion.poison.id, Math.min(tPollution / 4000, 1000), tPollution / 500000)); + case 3: + tEnt.addPotionEffect(new PotionEffect(Potion.blindness.id, Math.min(tPollution / 2000, 1000), 1)); + } } } // killing plants diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index 776f7176..55915125 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -141,7 +141,7 @@ public class GT_MetaTileEntity_Boiler_Bronze this.mTemperature += 1; } if(this.mProcessingEnergy>0 && (aTick % 20L == 0L)){ - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 40); } aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index 826b4c4d..0a59d6cd 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -120,7 +120,7 @@ public class GT_MetaTileEntity_Boiler_Lava } if(this.mProcessingEnergy>0 && (aTick % 20L == 0L)){ - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 40); } aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 223a62ef..0ec4ccf8 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -146,7 +146,7 @@ public class GT_MetaTileEntity_Boiler_Steel this.mTemperature += 1; } if(this.mProcessingEnergy>0 && (aTick % 20L == 0L)){ - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 60); } aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 1ba0bee7..d339c997 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -206,7 +206,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace } } if(this.mMachine && this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){ - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 75); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 400); } aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine)); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index fbb1b986..ed1d65f7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -86,7 +86,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock this.mEfficiency = 10000; this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), mMaxProgresstime*5); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), mMaxProgresstime*10); return true; } else { this.mEfficiency = 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 44803459..a4fa9733 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -220,7 +220,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace } public int getPollutionPerTick(ItemStack aStack) { - return 5; + return 10; } public int getDamageToComponent(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 10258521..4ac4a227 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -144,7 +144,7 @@ public class GT_MetaTileEntity_ImplosionCompressor } public int getPollutionPerTick(ItemStack aStack) { - return 100; + return 1000; } public int getDamageToComponent(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 21ba1bda..f3607936 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -226,7 +226,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler } public int getPollutionPerTick(ItemStack aStack) { - return 12; + return 20; } public int getDamageToComponent(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 2c97a2e2..232ef19f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -76,7 +76,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public int getPollutionPerTick(ItemStack aStack) { - return 8; + return 15; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index 26b12e81..847b5005 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -196,7 +196,7 @@ public class GT_MetaTileEntity_MultiFurnace } public int getPollutionPerTick(ItemStack aStack) { - return 5; + return 20; } public int getDamageToComponent(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 833ecf3c..c4dbb392 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -185,7 +185,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock @Override public int getPollutionPerTick(ItemStack aStack) { - return 20; + return 30; } @Override