Does the first part of the explosion (destroy blocks)
()
| 70 | * Does the first part of the explosion (destroy blocks) |
| 71 | */ |
| 72 | public void doExplosionA() |
| 73 | { |
| 74 | Set<BlockPos> set = Sets.<BlockPos>newHashSet(); |
| 75 | int i = 16; |
| 76 | |
| 77 | for (int j = 0; j < 16; ++j) |
| 78 | { |
| 79 | for (int k = 0; k < 16; ++k) |
| 80 | { |
| 81 | for (int l = 0; l < 16; ++l) |
| 82 | { |
| 83 | if (j == 0 || j == 15 || k == 0 || k == 15 || l == 0 || l == 15) |
| 84 | { |
| 85 | double d0 = (float)j / 15.0F * 2.0F - 1.0F; |
| 86 | double d1 = (float)k / 15.0F * 2.0F - 1.0F; |
| 87 | double d2 = (float)l / 15.0F * 2.0F - 1.0F; |
| 88 | double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); |
| 89 | d0 = d0 / d3; |
| 90 | d1 = d1 / d3; |
| 91 | d2 = d2 / d3; |
| 92 | float f = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); |
| 93 | double d4 = this.explosionX; |
| 94 | double d6 = this.explosionY; |
| 95 | double d8 = this.explosionZ; |
| 96 | |
| 97 | for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) |
| 98 | { |
| 99 | BlockPos blockpos = new BlockPos(d4, d6, d8); |
| 100 | IBlockState iblockstate = this.worldObj.getBlockState(blockpos); |
| 101 | |
| 102 | if (iblockstate.getBlock().getMaterial() != Material.air) |
| 103 | { |
| 104 | float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(null); |
| 105 | f -= (f2 + 0.3F) * 0.3F; |
| 106 | } |
| 107 | |
| 108 | if (f > 0.0F && (this.exploder == null || this.exploder.verifyExplosion(this, this.worldObj, blockpos, iblockstate, f))) |
| 109 | { |
| 110 | set.add(blockpos); |
| 111 | } |
| 112 | |
| 113 | d4 += d0 * 0.30000001192092896D; |
| 114 | d6 += d1 * 0.30000001192092896D; |
| 115 | d8 += d2 * 0.30000001192092896D; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | this.affectedBlockPositions.addAll(set); |
| 123 | float f3 = this.explosionSize * 2.0F; |
| 124 | int k1 = MathHelper.floor_double(this.explosionX - (double)f3 - 1.0D); |
| 125 | int l1 = MathHelper.floor_double(this.explosionX + (double)f3 + 1.0D); |
| 126 | int i2 = MathHelper.floor_double(this.explosionY - (double)f3 - 1.0D); |
| 127 | int i1 = MathHelper.floor_double(this.explosionY + (double)f3 + 1.0D); |
| 128 | int j2 = MathHelper.floor_double(this.explosionZ - (double)f3 - 1.0D); |
| 129 | int j1 = MathHelper.floor_double(this.explosionZ + (double)f3 + 1.0D); |
no test coverage detected