diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-09-25 18:34:40 +1000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-09-25 18:34:40 +1000 |
commit | c2310a3e78c2980a5924c007eca2b3e192bc3fd8 (patch) | |
tree | 4b0a3da3433d5833b4126cd02f957b8a3d6e7c27 /src/Java/gtPlusPlus/core/entity | |
parent | 35de0bbb41bd872800e62f34e02f4d859405d750 (diff) | |
download | GT5-Unofficial-c2310a3e78c2980a5924c007eca2b3e192bc3fd8.tar.gz GT5-Unofficial-c2310a3e78c2980a5924c007eca2b3e192bc3fd8.tar.bz2 GT5-Unofficial-c2310a3e78c2980a5924c007eca2b3e192bc3fd8.zip |
% Sulfuric potions now do no damage to anyone wearing a hazmat suit.
$ Fixed entity IDs during registration.
$ Fixed Sulfuric Potion not rendering.
$ Fixed Fluid Canner recipes for Sulfuric potion not registering.
Diffstat (limited to 'src/Java/gtPlusPlus/core/entity')
-rw-r--r-- | src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java | 12 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java | 92 |
2 files changed, 60 insertions, 44 deletions
diff --git a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java index b94f2e7205..954b886abe 100644 --- a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -2,14 +2,24 @@ package gtPlusPlus.core.entity; import cpw.mods.fml.common.registry.EntityRegistry; import gtPlusPlus.GTplusplus; +import gtPlusPlus.core.entity.monster.EntitySickBlaze; +import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; +import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; +import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; import gtPlusPlus.core.util.Utils; public class InternalEntityRegistry { + static int mEntityID = 0; + public static void registerEntities(){ Utils.LOG_INFO("Registering GT++ Entities."); //EntityRegistry.registerModEntity(EntityMiningChargePrimed.class, "MiningCharge", 3, Main.modInstance, 64, 20, true); - EntityRegistry.registerModEntity(EntityPrimedMiningExplosive.class, "MiningCharge", 3, GTplusplus.instance, 64, 20, true); + EntityRegistry.registerModEntity(EntityPrimedMiningExplosive.class, "MiningCharge", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityRegistry.registerModEntity(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityRegistry.registerModEntity(EntityToxinballSmall.class, "toxinBall", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityRegistry.registerModEntity(EntityStaballoyConstruct.class, "constructStaballoy", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityRegistry.registerModEntity(EntitySickBlaze.class, "sickBlaze", mEntityID++, GTplusplus.instance, 64, 20, true); } 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 |