예제 #1
0
  public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_) {
    int var7 = MathHelper.func_76128_c(p_70489_1_);
    int var8 = MathHelper.func_76128_c(p_70489_3_);
    int var9 = MathHelper.func_76128_c(p_70489_5_);
    if (BlockRailBase.func_72180_d_(this.field_70170_p, var7, var8 - 1, var9)) {
      --var8;
    }

    int var10 = this.field_70170_p.func_72798_a(var7, var8, var9);
    if (BlockRailBase.func_72184_d(var10)) {
      int var11 = this.field_70170_p.func_72805_g(var7, var8, var9);
      p_70489_3_ = (double) var8;
      if (((BlockRailBase) Block.field_71973_m[var10]).func_72183_n()) {
        var11 &= 7;
      }

      if (var11 >= 2 && var11 <= 5) {
        p_70489_3_ = (double) (var8 + 1);
      }

      int[][] var12 = field_70500_g[var11];
      double var13 = 0.0D;
      double var15 = (double) var7 + 0.5D + (double) var12[0][0] * 0.5D;
      double var17 = (double) var8 + 0.5D + (double) var12[0][1] * 0.5D;
      double var19 = (double) var9 + 0.5D + (double) var12[0][2] * 0.5D;
      double var21 = (double) var7 + 0.5D + (double) var12[1][0] * 0.5D;
      double var23 = (double) var8 + 0.5D + (double) var12[1][1] * 0.5D;
      double var25 = (double) var9 + 0.5D + (double) var12[1][2] * 0.5D;
      double var27 = var21 - var15;
      double var29 = (var23 - var17) * 2.0D;
      double var31 = var25 - var19;
      if (var27 == 0.0D) {
        p_70489_1_ = (double) var7 + 0.5D;
        var13 = p_70489_5_ - (double) var9;
      } else if (var31 == 0.0D) {
        p_70489_5_ = (double) var9 + 0.5D;
        var13 = p_70489_1_ - (double) var7;
      } else {
        double var33 = p_70489_1_ - var15;
        double var35 = p_70489_5_ - var19;
        var13 = (var33 * var27 + var35 * var31) * 2.0D;
      }

      p_70489_1_ = var15 + var27 * var13;
      p_70489_3_ = var17 + var29 * var13;
      p_70489_5_ = var19 + var31 * var13;
      if (var29 < 0.0D) {
        ++p_70489_3_;
      }

      if (var29 > 0.0D) {
        p_70489_3_ += 0.5D;
      }

      return this.field_70170_p.func_82732_R().func_72345_a(p_70489_1_, p_70489_3_, p_70489_5_);
    } else {
      return null;
    }
  }
 public float func_82146_a(
     Explosion p_82146_1_,
     World p_82146_2_,
     int p_82146_3_,
     int p_82146_4_,
     int p_82146_5_,
     Block p_82146_6_) {
   return this.func_96096_ay()
           && (BlockRailBase.func_72184_d(p_82146_6_.field_71990_ca)
               || BlockRailBase.func_72180_d_(p_82146_2_, p_82146_3_, p_82146_4_ + 1, p_82146_5_))
       ? 0.0F
       : super.func_82146_a(
           p_82146_1_, p_82146_2_, p_82146_3_, p_82146_4_, p_82146_5_, p_82146_6_);
 }
 public boolean func_96091_a(
     Explosion p_96091_1_,
     World p_96091_2_,
     int p_96091_3_,
     int p_96091_4_,
     int p_96091_5_,
     int p_96091_6_,
     float p_96091_7_) {
   return this.func_96096_ay()
           && (BlockRailBase.func_72184_d(p_96091_6_)
               || BlockRailBase.func_72180_d_(p_96091_2_, p_96091_3_, p_96091_4_ + 1, p_96091_5_))
       ? false
       : super.func_96091_a(
           p_96091_1_, p_96091_2_, p_96091_3_, p_96091_4_, p_96091_5_, p_96091_6_, p_96091_7_);
 }
예제 #4
0
  public void func_70071_h_() {
    if (this.field_82344_g != null) {
      this.field_82344_g.func_73660_a();
    }

    if (this.func_70496_j() > 0) {
      this.func_70497_h(this.func_70496_j() - 1);
    }

    if (this.func_70491_i() > 0) {
      this.func_70492_c(this.func_70491_i() - 1);
    }

    if (this.field_70163_u < -64.0D) {
      this.func_70076_C();
    }

    int var2;
    if (!this.field_70170_p.field_72995_K && this.field_70170_p instanceof WorldServer) {
      this.field_70170_p.field_72984_F.func_76320_a("portal");
      MinecraftServer var1 = ((WorldServer) this.field_70170_p).func_73046_m();
      var2 = this.func_82145_z();
      if (this.field_71087_bX) {
        if (var1.func_71255_r()) {
          if (this.field_70154_o == null && this.field_82153_h++ >= var2) {
            this.field_82153_h = var2;
            this.field_71088_bW = this.func_82147_ab();
            byte var3;
            if (this.field_70170_p.field_73011_w.field_76574_g == -1) {
              var3 = 0;
            } else {
              var3 = -1;
            }

            this.func_71027_c(var3);
          }

          this.field_71087_bX = false;
        }
      } else {
        if (this.field_82153_h > 0) {
          this.field_82153_h -= 4;
        }

        if (this.field_82153_h < 0) {
          this.field_82153_h = 0;
        }
      }

      if (this.field_71088_bW > 0) {
        --this.field_71088_bW;
      }

      this.field_70170_p.field_72984_F.func_76319_b();
    }

    if (this.field_70170_p.field_72995_K) {
      if (this.field_70510_h > 0) {
        double var19 =
            this.field_70165_t
                + (this.field_70511_i - this.field_70165_t) / (double) this.field_70510_h;
        double var21 =
            this.field_70163_u
                + (this.field_70509_j - this.field_70163_u) / (double) this.field_70510_h;
        double var5 =
            this.field_70161_v
                + (this.field_70514_an - this.field_70161_v) / (double) this.field_70510_h;
        double var7 = MathHelper.func_76138_g(this.field_70512_ao - (double) this.field_70177_z);
        this.field_70177_z =
            (float) ((double) this.field_70177_z + var7 / (double) this.field_70510_h);
        this.field_70125_A =
            (float)
                ((double) this.field_70125_A
                    + (this.field_70513_ap - (double) this.field_70125_A)
                        / (double) this.field_70510_h);
        --this.field_70510_h;
        this.func_70107_b(var19, var21, var5);
        this.func_70101_b(this.field_70177_z, this.field_70125_A);
      } else {
        this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
        this.func_70101_b(this.field_70177_z, this.field_70125_A);
      }

    } else {
      this.field_70169_q = this.field_70165_t;
      this.field_70167_r = this.field_70163_u;
      this.field_70166_s = this.field_70161_v;
      this.field_70181_x -= 0.03999999910593033D;
      int var18 = MathHelper.func_76128_c(this.field_70165_t);
      var2 = MathHelper.func_76128_c(this.field_70163_u);
      int var20 = MathHelper.func_76128_c(this.field_70161_v);
      if (BlockRailBase.func_72180_d_(this.field_70170_p, var18, var2 - 1, var20)) {
        --var2;
      }

      double var4 = 0.4D;
      double var6 = 0.0078125D;
      int var8 = this.field_70170_p.func_72798_a(var18, var2, var20);
      if (BlockRailBase.func_72184_d(var8)) {
        int var9 = this.field_70170_p.func_72805_g(var18, var2, var20);
        this.func_94091_a(var18, var2, var20, var4, var6, var8, var9);
        if (var8 == Block.field_94337_cv.field_71990_ca) {
          this.func_96095_a(var18, var2, var20, (var9 & 8) != 0);
        }
      } else {
        this.func_94088_b(var4);
      }

      this.func_70017_D();
      this.field_70125_A = 0.0F;
      double var22 = this.field_70169_q - this.field_70165_t;
      double var11 = this.field_70166_s - this.field_70161_v;
      if (var22 * var22 + var11 * var11 > 0.0010D) {
        this.field_70177_z = (float) (Math.atan2(var11, var22) * 180.0D / 3.141592653589793D);
        if (this.field_70499_f) {
          this.field_70177_z += 180.0F;
        }
      }

      double var13 = (double) MathHelper.func_76142_g(this.field_70177_z - this.field_70126_B);
      if (var13 < -170.0D || var13 >= 170.0D) {
        this.field_70177_z += 180.0F;
        this.field_70499_f = !this.field_70499_f;
      }

      this.func_70101_b(this.field_70177_z, this.field_70125_A);
      List var15 =
          this.field_70170_p.func_72839_b(
              this,
              this.field_70121_D.func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
      if (var15 != null && !var15.isEmpty()) {
        for (int var16 = 0; var16 < var15.size(); ++var16) {
          Entity var17 = (Entity) var15.get(var16);
          if (var17 != this.field_70153_n
              && var17.func_70104_M()
              && var17 instanceof EntityMinecart) {
            var17.func_70108_f(this);
          }
        }
      }

      if (this.field_70153_n != null && this.field_70153_n.field_70128_L) {
        if (this.field_70153_n.field_70154_o == this) {
          this.field_70153_n.field_70154_o = null;
        }

        this.field_70153_n = null;
      }
    }
  }