MOOOOORE POLLUTION

This commit is contained in:
Technus 2016-11-01 20:45:28 +01:00
parent 3449841e16
commit 24346044a1
17 changed files with 38 additions and 26 deletions

View file

@ -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);
}
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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)))));
}
}

View file

@ -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

View file

@ -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<EntityLivingBase> 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<EntityLiving> 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

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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));

View file

@ -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;

View file

@ -220,7 +220,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
public int getPollutionPerTick(ItemStack aStack) {
return 5;
return 10;
}
public int getDamageToComponent(ItemStack aStack) {

View file

@ -144,7 +144,7 @@ public class GT_MetaTileEntity_ImplosionCompressor
}
public int getPollutionPerTick(ItemStack aStack) {
return 100;
return 1000;
}
public int getDamageToComponent(ItemStack aStack) {

View file

@ -226,7 +226,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
}
public int getPollutionPerTick(ItemStack aStack) {
return 12;
return 20;
}
public int getDamageToComponent(ItemStack aStack) {

View file

@ -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

View file

@ -196,7 +196,7 @@ public class GT_MetaTileEntity_MultiFurnace
}
public int getPollutionPerTick(ItemStack aStack) {
return 5;
return 20;
}
public int getDamageToComponent(ItemStack aStack) {

View file

@ -185,7 +185,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock
@Override
public int getPollutionPerTick(ItemStack aStack) {
return 20;
return 30;
}
@Override