@SuppressWarnings({"rawtypes","unchecked"}) protected void affectEntitiesWithin(){
  float diameter=explosionSize * 2.0F;
  int i=MathHelper.floor_double(explosionX - (double)explosionSize - 1.0D);
  int j=MathHelper.floor_double(explosionX + (double)explosionSize + 1.0D);
  int k=MathHelper.floor_double(explosionY - (double)explosionSize - 1.0D);
  int l1=MathHelper.floor_double(explosionY + (double)explosionSize + 1.0D);
  int i2=MathHelper.floor_double(explosionZ - (double)explosionSize - 1.0D);
  int j2=MathHelper.floor_double(explosionZ + (double)explosionSize + 1.0D);
  List list=worldObj.getEntitiesWithinAABBExcludingEntity(exploder,AxisAlignedBB.getBoundingBox((double)i,(double)k,(double)i2,(double)j,(double)l1,(double)j2));
  Vec3 vec3=Vec3.createVectorHelper(explosionX,explosionY,explosionZ);
  for (int k2=0; k2 < list.size(); ++k2) {
    Entity entity=(Entity)list.get(k2);
    double d7=(scalesWithDistance ? entity.getDistance(explosionX,explosionY,explosionZ) / (double)diameter : 0.0D);
    if (d7 <= 1.0D) {
      double d0=entity.posX - explosionX;
      double d1=entity.posY + (double)entity.getEyeHeight() - explosionY;
      double d2=entity.posZ - explosionZ;
      double d8=(double)MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2);
      if (d8 != 0.0D) {
        d0/=d8;
        d1/=d8;
        d2/=d8;
        double d9=(double)worldObj.getBlockDensity(vec3,entity.boundingBox);
        double d10=(1.0D - d7) * d9;
        float amount=(damage == 0.0F ? (float)((int)((d10 * d10 + d10) / 2.0D * 8.0D * diameter + 1.0D)) : damage * (float)d10);
        if (entity.attackEntityFrom(getDamageSource(),amount) && isFlaming && !entity.isImmuneToFire()) {
          if (!scalesWithDistance || rand.nextFloat() < d10) {
            entity.setFire(burnTime);
          }
        }
        double d11=EnchantmentProtection.func_92092_a(entity,d10);
        entity.motionX+=d0 * d11 * motionFactor;
        entity.motionY+=d1 * d11 * motionFactor;
        entity.motionZ+=d2 * d11 * motionFactor;
        if (entity instanceof EntityPlayer) {
          affectedPlayers.put((EntityPlayer)entity,Vec3.createVectorHelper(d0 * d10,d1 * d10,d2 * d10));
        }
      }
    }
  }
}

@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) protected void affectEntitiesWithin ( ) { float diameter = explosionSize * 2.0F ; int i = MathHelper . floor_double ( explosionX - ( double ) explosionSize - 1.0D ) ; int j = MathHelper . floor_double ( explosionX + ( double ) explosionSize + 1.0D ) ; int k = MathHelper . floor_double ( explosionY - ( double ) explosionSize - 1.0D ) ; int l1 = MathHelper . floor_double ( explosionY + ( double ) explosionSize + 1.0D ) ; int i2 = MathHelper . floor_double ( explosionZ - ( double ) explosionSize - 1.0D ) ; int j2 = MathHelper . floor_double ( explosionZ + ( double ) explosionSize + 1.0D ) ; List list = worldObj . getEntitiesWithinAABBExcludingEntity ( exploder , AxisAlignedBB . getBoundingBox ( ( double ) i , ( double ) k , ( double ) i2 , ( double ) j , ( double ) l1 , ( double ) j2 ) ) ; Vec3 vec3 = Vec3 . createVectorHelper ( explosionX , explosionY , explosionZ ) ; for ( int k2 = 0 ; k2 < list . size ( ) ; ++ k2 ) { Entity entity = ( Entity ) list . get ( k2 ) ; double d7 = ( scalesWithDistance ? entity . getDistance ( explosionX , explosionY , explosionZ ) / ( double ) diameter : 0.0D ) ; if ( d7 <= 1.0D ) { double d0 = entity . posX - explosionX ; double d1 = entity . posY + ( double ) entity . getEyeHeight ( ) - explosionY ; double d2 = entity . posZ - explosionZ ; double d8 = ( double ) MathHelper . sqrt_double ( d0 * d0 + d1 * d1 + d2 * d2 ) ; if ( d8 != 0.0D ) { d0 /= d8 ; d1 /= d8 ; d2 /= d8 ; double d9 = ( double ) worldObj . getBlockDensity ( vec3 , entity . boundingBox ) ; double d10 = ( 1.0D - d7 ) * d9 ; float amount = ( damage == 0.0F ? ( float ) ( ( int ) ( ( d10 * d10 + d10 ) / 2.0D * 8.0D * diameter + 1.0D ) ) : damage * ( float ) d10 ) ; if ( entity . attackEntityFrom ( getDamageSource ( ) , amount ) && isFlaming && ! entity . isImmuneToFire ( ) ) { if ( ! scalesWithDistance || rand . nextFloat ( ) < d10 ) { entity . setFire ( burnTime ) ; } } double d11 = EnchantmentProtection . func_92092_a ( entity , d10 ) ; entity . motionX += d0 * d11 * motionFactor ; entity . motionY += d1 * d11 * motionFactor ; entity . motionZ += d2 * d11 * motionFactor ; if ( entity instanceof EntityPlayer ) { affectedPlayers . put ( ( EntityPlayer ) entity , Vec3 . createVectorHelper ( d0 * d10 , d1 * d10 , d2 * d10 ) ) ; } } } } }
affects all entities within the explosion , causing damage if flagged to do so
