diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/entity/projectile')
-rw-r--r-- | src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java | 92 |
1 files changed, 49 insertions, 43 deletions
diff --git a/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java b/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java index b12dc7e0a8..91034e08b4 100644 --- a/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java +++ b/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.entity.projectile; +import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; import gtPlusPlus.core.util.PollutionUtils; import gtPlusPlus.core.util.array.BlockPos; @@ -37,10 +38,12 @@ public class EntitySulfuricAcidPotion extends EntityThrowable { int zBlock = object.blockZ; if (object.entityHit != null) { byte b0 = 6; - object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) b0); - EntityUtils.setEntityOnFire(object.entityHit, 10); - object.entityHit.fireResistance = 0; - ravage(new BlockPos(xBlock, yBlock, zBlock)); + if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)){ + object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) b0); + EntityUtils.setEntityOnFire(object.entityHit, 10); + object.entityHit.fireResistance = 0; + ravage(new BlockPos(xBlock, yBlock, zBlock)); + } } if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){ ravage(new BlockPos(xBlock, yBlock, zBlock)); @@ -51,59 +54,62 @@ public class EntitySulfuricAcidPotion extends EntityThrowable { for (int i = 0; i < 24; ++i) { if ((e = MathUtils.randInt(0, 5)) <= 1){ if (e==0) - mParticleType = "largesmoke"; + mParticleType = "largesmoke"; if (e==1) - mParticleType = "flame"; + mParticleType = "flame"; } - this.worldObj.spawnParticle(mParticleType, this.posX+MathUtils.randDouble(0, 2), this.posY+MathUtils.randDouble(0, 2), this.posZ+MathUtils.randDouble(0, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle(mParticleType, this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); } if (!this.worldObj.isRemote) { this.setDead(); } } - + private boolean ravage(BlockPos blockpos){ - - for (int i=(blockpos.xPos-1);i<(blockpos.xPos+1);i++){ - for (int j=(blockpos.yPos-1);j<(blockpos.yPos+1);j++){ - for (int h=(blockpos.zPos-1);h<(blockpos.zPos+1);h++){ - - Block mBlockhit = worldObj.getBlock(i, j, h); - this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 2), this.posY+MathUtils.randDouble(0, 2), this.posZ+MathUtils.randDouble(0, 2), 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 2), this.posY+MathUtils.randDouble(0, 2), this.posZ+MathUtils.randDouble(0, 2), 0.0D, 0.0D, 0.0D); - - int mPol = 500000000; - - GT_Pollution.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), mPol); - - if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium){ - worldObj.setBlock(i, j+1, h, Blocks.fire); - worldObj.setBlock(i, j, h, Blocks.dirt); - } - else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2){ - worldObj.setBlock(i, j, h, Blocks.fire); - } - else if (mBlockhit == Blocks.tallgrass){ - worldObj.setBlock(i, j, h, Blocks.fire); - if (worldObj.getBlock(i, j-1, h) == Blocks.grass){ - worldObj.setBlock(i, j-1, h, Blocks.dirt); + + int radius = 1; + + for (int i=(blockpos.xPos-radius);i<(blockpos.xPos+radius);i++){ + for (int j=(blockpos.yPos-radius);j<(blockpos.yPos+radius);j++){ + for (int h=(blockpos.zPos-radius);h<(blockpos.zPos+radius);h++){ + + int mChance = MathUtils.randInt(1, 10); + if (mChance <= 3){ + Block mBlockhit = worldObj.getBlock(i, j, h); + this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D); + + //GT_Pollution.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), mPol); + + if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium){ + worldObj.setBlock(i, j+1, h, Blocks.fire); + worldObj.setBlock(i, j, h, Blocks.dirt); } + else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2){ + worldObj.setBlock(i, j, h, Blocks.fire); + } + else if (mBlockhit == Blocks.tallgrass){ + worldObj.setBlock(i, j, h, Blocks.fire); + if (worldObj.getBlock(i, j-1, h) == Blocks.grass){ + worldObj.setBlock(i, j-1, h, Blocks.dirt); + } + } + else if (mBlockhit == Blocks.carrots || mBlockhit == Blocks.melon_block || mBlockhit == Blocks.pumpkin || mBlockhit == Blocks.potatoes){ + worldObj.setBlock(i, j+1, h, Blocks.fire); + worldObj.setBlock(i, j, h, Blocks.dirt); + } + else if (mBlockhit == Blocks.air){ + worldObj.setBlock(i, j, h, Blocks.fire); + } } - else if (mBlockhit == Blocks.carrots || mBlockhit == Blocks.melon_block || mBlockhit == Blocks.pumpkin || mBlockhit == Blocks.potatoes){ - worldObj.setBlock(i, j+1, h, Blocks.fire); - worldObj.setBlock(i, j, h, Blocks.dirt); - } - else if (mBlockhit == Blocks.air){ - worldObj.setBlock(i, j, h, Blocks.fire); - } } } } - - + + return true; } - - + + }
\ No newline at end of file |