Exemplo n.º 1
0
 public double func_72433_c() {
   return (double)
       MathHelper.func_76133_a(
           this.field_72450_a * this.field_72450_a
               + this.field_72448_b * this.field_72448_b
               + this.field_72449_c * this.field_72449_c);
 }
  public void func_75649_a() {
    this.field_75659_a.field_70125_A = 0.0F;
    if (this.field_75655_d) {
      this.field_75655_d = false;
      double var1 = this.field_75656_e - this.field_75659_a.field_70165_t;
      double var3 =
          this.field_75653_f
              - (this.field_75659_a.field_70163_u + (double) this.field_75659_a.func_70047_e());
      double var5 = this.field_75654_g - this.field_75659_a.field_70161_v;
      double var7 = (double) MathHelper.func_76133_a(var1 * var1 + var5 * var5);
      float var9 = (float) (Math.atan2(var5, var1) * 180.0D / 3.1415927410125732D) - 90.0F;
      float var10 = (float) (-(Math.atan2(var3, var7) * 180.0D / 3.1415927410125732D));
      this.field_75659_a.field_70125_A =
          this.func_75652_a(this.field_75659_a.field_70125_A, var10, this.field_75658_c);
      this.field_75659_a.field_70759_as =
          this.func_75652_a(this.field_75659_a.field_70759_as, var9, this.field_75657_b);
    } else {
      this.field_75659_a.field_70759_as =
          this.func_75652_a(
              this.field_75659_a.field_70759_as, this.field_75659_a.field_70761_aq, 10.0F);
    }

    float var11 =
        MathHelper.func_76142_g(
            this.field_75659_a.field_70759_as - this.field_75659_a.field_70761_aq);
    if (!this.field_75659_a.func_70661_as().func_75500_f()) {
      if (var11 < -75.0F) {
        this.field_75659_a.field_70759_as = this.field_75659_a.field_70761_aq - 75.0F;
      }

      if (var11 > 75.0F) {
        this.field_75659_a.field_70759_as = this.field_75659_a.field_70761_aq + 75.0F;
      }
    }
  }
Exemplo n.º 3
0
  public void func_70612_e(float p_70612_1_, float p_70612_2_) {
    if (this.func_70090_H()) {
      this.func_70060_a(p_70612_1_, p_70612_2_, 0.02F);
      this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y);
      this.field_70159_w *= 0.800000011920929D;
      this.field_70181_x *= 0.800000011920929D;
      this.field_70179_y *= 0.800000011920929D;
    } else if (this.func_70058_J()) {
      this.func_70060_a(p_70612_1_, p_70612_2_, 0.02F);
      this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y);
      this.field_70159_w *= 0.5D;
      this.field_70181_x *= 0.5D;
      this.field_70179_y *= 0.5D;
    } else {
      float var3 = 0.91F;
      if (this.field_70122_E) {
        var3 = 0.54600006F;
        int var4 =
            this.field_70170_p.func_72798_a(
                MathHelper.func_76128_c(this.field_70165_t),
                MathHelper.func_76128_c(this.field_70121_D.field_72338_b) - 1,
                MathHelper.func_76128_c(this.field_70161_v));
        if (var4 > 0) {
          var3 = Block.field_71973_m[var4].field_72016_cq * 0.91F;
        }
      }

      float var8 = 0.16277136F / (var3 * var3 * var3);
      this.func_70060_a(p_70612_1_, p_70612_2_, this.field_70122_E ? 0.1F * var8 : 0.02F);
      var3 = 0.91F;
      if (this.field_70122_E) {
        var3 = 0.54600006F;
        int var5 =
            this.field_70170_p.func_72798_a(
                MathHelper.func_76128_c(this.field_70165_t),
                MathHelper.func_76128_c(this.field_70121_D.field_72338_b) - 1,
                MathHelper.func_76128_c(this.field_70161_v));
        if (var5 > 0) {
          var3 = Block.field_71973_m[var5].field_72016_cq * 0.91F;
        }
      }

      this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y);
      this.field_70159_w *= (double) var3;
      this.field_70181_x *= (double) var3;
      this.field_70179_y *= (double) var3;
    }

    this.field_70722_aY = this.field_70721_aZ;
    double var10 = this.field_70165_t - this.field_70169_q;
    double var9 = this.field_70161_v - this.field_70166_s;
    float var7 = MathHelper.func_76133_a(var10 * var10 + var9 * var9) * 4.0F;
    if (var7 > 1.0F) {
      var7 = 1.0F;
    }

    this.field_70721_aZ += (var7 - this.field_70721_aZ) * 0.4F;
    this.field_70754_ba += this.field_70721_aZ;
  }
Exemplo n.º 4
0
 public Vec3 func_72432_b() {
   double var1 =
       (double)
           MathHelper.func_76133_a(
               this.field_72450_a * this.field_72450_a
                   + this.field_72448_b * this.field_72448_b
                   + this.field_72449_c * this.field_72449_c);
   return var1 < 1.0E-4D
       ? this.field_72447_d.func_72345_a(0.0D, 0.0D, 0.0D)
       : this.field_72447_d.func_72345_a(
           this.field_72450_a / var1, this.field_72448_b / var1, this.field_72449_c / var1);
 }
 public void func_75249_e() {
   double var1 = this.field_75326_b.field_70165_t - this.field_75328_a.field_70165_t;
   double var3 = this.field_75326_b.field_70161_v - this.field_75328_a.field_70161_v;
   float var5 = MathHelper.func_76133_a(var1 * var1 + var3 * var3);
   this.field_75328_a.field_70159_w +=
       var1 / (double) var5 * 0.5D * 0.800000011920929D
           + this.field_75328_a.field_70159_w * 0.20000000298023224D;
   this.field_75328_a.field_70179_y +=
       var3 / (double) var5 * 0.5D * 0.800000011920929D
           + this.field_75328_a.field_70179_y * 0.20000000298023224D;
   this.field_75328_a.field_70181_x = (double) this.field_75327_c;
 }
Exemplo n.º 6
0
 public double func_72438_d(Vec3 p_72438_1_) {
   double var2 = p_72438_1_.field_72450_a - this.field_72450_a;
   double var4 = p_72438_1_.field_72448_b - this.field_72448_b;
   double var6 = p_72438_1_.field_72449_c - this.field_72449_c;
   return (double) MathHelper.func_76133_a(var2 * var2 + var4 * var4 + var6 * var6);
 }
Exemplo n.º 7
0
  public void func_70108_f(Entity p_70108_1_) {
    if (!this.field_70170_p.field_72995_K) {
      if (p_70108_1_ != this.field_70153_n) {
        if (p_70108_1_ instanceof EntityLivingBase
            && !(p_70108_1_ instanceof EntityPlayer)
            && !(p_70108_1_ instanceof EntityIronGolem)
            && this.func_94087_l() == 0
            && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y
                > 0.01D
            && this.field_70153_n == null
            && p_70108_1_.field_70154_o == null) {
          p_70108_1_.func_70078_a(this);
        }

        double var2 = p_70108_1_.field_70165_t - this.field_70165_t;
        double var4 = p_70108_1_.field_70161_v - this.field_70161_v;
        double var6 = var2 * var2 + var4 * var4;
        if (var6 >= 9.999999747378752E-5D) {
          var6 = (double) MathHelper.func_76133_a(var6);
          var2 /= var6;
          var4 /= var6;
          double var8 = 1.0D / var6;
          if (var8 > 1.0D) {
            var8 = 1.0D;
          }

          var2 *= var8;
          var4 *= var8;
          var2 *= 0.10000000149011612D;
          var4 *= 0.10000000149011612D;
          var2 *= (double) (1.0F - this.field_70144_Y);
          var4 *= (double) (1.0F - this.field_70144_Y);
          var2 *= 0.5D;
          var4 *= 0.5D;
          if (p_70108_1_ instanceof EntityMinecart) {
            double var10 = p_70108_1_.field_70165_t - this.field_70165_t;
            double var12 = p_70108_1_.field_70161_v - this.field_70161_v;
            Vec3 var14 =
                this.field_70170_p.func_82732_R().func_72345_a(var10, 0.0D, var12).func_72432_b();
            Vec3 var15 =
                this.field_70170_p
                    .func_82732_R()
                    .func_72345_a(
                        (double) MathHelper.func_76134_b(this.field_70177_z * 3.1415927F / 180.0F),
                        0.0D,
                        (double) MathHelper.func_76126_a(this.field_70177_z * 3.1415927F / 180.0F))
                    .func_72432_b();
            double var16 = Math.abs(var14.func_72430_b(var15));
            if (var16 < 0.800000011920929D) {
              return;
            }

            double var18 = p_70108_1_.field_70159_w + this.field_70159_w;
            double var20 = p_70108_1_.field_70179_y + this.field_70179_y;
            if (((EntityMinecart) p_70108_1_).func_94087_l() == 2 && this.func_94087_l() != 2) {
              this.field_70159_w *= 0.20000000298023224D;
              this.field_70179_y *= 0.20000000298023224D;
              this.func_70024_g(
                  p_70108_1_.field_70159_w - var2, 0.0D, p_70108_1_.field_70179_y - var4);
              p_70108_1_.field_70159_w *= 0.949999988079071D;
              p_70108_1_.field_70179_y *= 0.949999988079071D;
            } else if (((EntityMinecart) p_70108_1_).func_94087_l() != 2
                && this.func_94087_l() == 2) {
              p_70108_1_.field_70159_w *= 0.20000000298023224D;
              p_70108_1_.field_70179_y *= 0.20000000298023224D;
              p_70108_1_.func_70024_g(this.field_70159_w + var2, 0.0D, this.field_70179_y + var4);
              this.field_70159_w *= 0.949999988079071D;
              this.field_70179_y *= 0.949999988079071D;
            } else {
              var18 /= 2.0D;
              var20 /= 2.0D;
              this.field_70159_w *= 0.20000000298023224D;
              this.field_70179_y *= 0.20000000298023224D;
              this.func_70024_g(var18 - var2, 0.0D, var20 - var4);
              p_70108_1_.field_70159_w *= 0.20000000298023224D;
              p_70108_1_.field_70179_y *= 0.20000000298023224D;
              p_70108_1_.func_70024_g(var18 + var2, 0.0D, var20 + var4);
            }
          } else {
            this.func_70024_g(-var2, 0.0D, -var4);
            p_70108_1_.func_70024_g(var2 / 4.0D, 0.0D, var4 / 4.0D);
          }
        }
      }
    }
  }