Example #1
0
 public boolean func_77648_a(
     ItemStack p_77648_1_,
     EntityPlayer p_77648_2_,
     World p_77648_3_,
     int p_77648_4_,
     int p_77648_5_,
     int p_77648_6_,
     int p_77648_7_,
     float p_77648_8_,
     float p_77648_9_,
     float p_77648_10_) {
   if (!p_77648_2_.func_71031_e(p_77648_4_, p_77648_5_, p_77648_6_)) {
     return false;
   } else {
     int var11 = p_77648_3_.func_72798_a(p_77648_4_, p_77648_5_, p_77648_6_);
     int var12 = p_77648_3_.func_72798_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_);
     if ((p_77648_7_ == 0 || var12 != 0 || var11 != Block.field_71980_u.field_71990_ca)
         && var11 != Block.field_71979_v.field_71990_ca) {
       return false;
     } else {
       Block var13 = Block.field_72050_aA;
       p_77648_3_.func_72908_a(
           (double) ((float) p_77648_4_ + 0.5F),
           (double) ((float) p_77648_5_ + 0.5F),
           (double) ((float) p_77648_6_ + 0.5F),
           var13.field_72020_cn.func_72675_d(),
           (var13.field_72020_cn.func_72677_b() + 1.0F) / 2.0F,
           var13.field_72020_cn.func_72678_c() * 0.8F);
       if (p_77648_3_.field_72995_K) {
         return true;
       } else {
         p_77648_3_.func_72859_e(p_77648_4_, p_77648_5_, p_77648_6_, var13.field_71990_ca);
         p_77648_1_.func_77972_a(1, p_77648_2_);
         return true;
       }
     }
   }
 }
Example #2
0
  public void func_71847_b(
      World p_71847_1_, int p_71847_2_, int p_71847_3_, int p_71847_4_, Random p_71847_5_) {
    super.func_71847_b(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_, p_71847_5_);
    if (p_71847_1_.func_72957_l(p_71847_2_, p_71847_3_ + 1, p_71847_4_) >= 9) {
      float var6 = this.func_72266_n(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_);
      if (p_71847_5_.nextInt((int) (25.0F / var6) + 1) == 0) {
        int var7 = p_71847_1_.func_72805_g(p_71847_2_, p_71847_3_, p_71847_4_);
        if (var7 < 7) {
          ++var7;
          p_71847_1_.func_72921_c(p_71847_2_, p_71847_3_, p_71847_4_, var7);
        } else {
          if (p_71847_1_.func_72798_a(p_71847_2_ - 1, p_71847_3_, p_71847_4_)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          if (p_71847_1_.func_72798_a(p_71847_2_ + 1, p_71847_3_, p_71847_4_)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          if (p_71847_1_.func_72798_a(p_71847_2_, p_71847_3_, p_71847_4_ - 1)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          if (p_71847_1_.func_72798_a(p_71847_2_, p_71847_3_, p_71847_4_ + 1)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          int var8 = p_71847_5_.nextInt(4);
          int var9 = p_71847_2_;
          int var10 = p_71847_4_;
          if (var8 == 0) {
            var9 = p_71847_2_ - 1;
          }

          if (var8 == 1) {
            ++var9;
          }

          if (var8 == 2) {
            var10 = p_71847_4_ - 1;
          }

          if (var8 == 3) {
            ++var10;
          }

          int var11 = p_71847_1_.func_72798_a(var9, p_71847_3_ - 1, var10);
          if (p_71847_1_.func_72798_a(var9, p_71847_3_, var10) == 0
              && (var11 == Block.field_72050_aA.field_71990_ca
                  || var11 == Block.field_71979_v.field_71990_ca
                  || var11 == Block.field_71980_u.field_71990_ca)) {
            p_71847_1_.func_72859_e(var9, p_71847_3_, var10, this.field_72267_a.field_71990_ca);
          }
        }
      }
    }
  }
  public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
    float var4 = 1.0F;
    double var5 =
        p_77659_3_.field_70169_q
            + (p_77659_3_.field_70165_t - p_77659_3_.field_70169_q) * (double) var4;
    double var7 =
        p_77659_3_.field_70167_r
            + (p_77659_3_.field_70163_u - p_77659_3_.field_70167_r) * (double) var4
            + 1.62D
            - (double) p_77659_3_.field_70129_M;
    double var9 =
        p_77659_3_.field_70166_s
            + (p_77659_3_.field_70161_v - p_77659_3_.field_70166_s) * (double) var4;
    boolean var11 = this.field_77876_a == 0;
    MovingObjectPosition var12 = this.func_77621_a(p_77659_2_, p_77659_3_, var11);
    if (var12 == null) {
      return p_77659_1_;
    } else {
      if (var12.field_72313_a == EnumMovingObjectType.TILE) {
        int var13 = var12.field_72311_b;
        int var14 = var12.field_72312_c;
        int var15 = var12.field_72309_d;
        if (!p_77659_2_.func_72962_a(p_77659_3_, var13, var14, var15)) {
          return p_77659_1_;
        }

        if (this.field_77876_a == 0) {
          if (!p_77659_3_.func_71031_e(var13, var14, var15)) {
            return p_77659_1_;
          }

          if (p_77659_2_.func_72803_f(var13, var14, var15) == Material.field_76244_g
              && p_77659_2_.func_72805_g(var13, var14, var15) == 0) {
            p_77659_2_.func_72859_e(var13, var14, var15, 0);
            if (p_77659_3_.field_71075_bZ.field_75098_d) {
              return p_77659_1_;
            }

            if (--p_77659_1_.field_77994_a <= 0) {
              return new ItemStack(Item.field_77786_ax);
            }

            if (!p_77659_3_.field_71071_by.func_70441_a(new ItemStack(Item.field_77786_ax))) {
              p_77659_3_.func_71021_b(new ItemStack(Item.field_77786_ax.field_77779_bT, 1, 0));
            }

            return p_77659_1_;
          }

          if (p_77659_2_.func_72803_f(var13, var14, var15) == Material.field_76256_h
              && p_77659_2_.func_72805_g(var13, var14, var15) == 0) {
            p_77659_2_.func_72859_e(var13, var14, var15, 0);
            if (p_77659_3_.field_71075_bZ.field_75098_d) {
              return p_77659_1_;
            }

            if (--p_77659_1_.field_77994_a <= 0) {
              return new ItemStack(Item.field_77775_ay);
            }

            if (!p_77659_3_.field_71071_by.func_70441_a(new ItemStack(Item.field_77775_ay))) {
              p_77659_3_.func_71021_b(new ItemStack(Item.field_77775_ay.field_77779_bT, 1, 0));
            }

            return p_77659_1_;
          }
        } else {
          if (this.field_77876_a < 0) {
            return new ItemStack(Item.field_77788_aw);
          }

          if (var12.field_72310_e == 0) {
            --var14;
          }

          if (var12.field_72310_e == 1) {
            ++var14;
          }

          if (var12.field_72310_e == 2) {
            --var15;
          }

          if (var12.field_72310_e == 3) {
            ++var15;
          }

          if (var12.field_72310_e == 4) {
            --var13;
          }

          if (var12.field_72310_e == 5) {
            ++var13;
          }

          if (!p_77659_3_.func_71031_e(var13, var14, var15)) {
            return p_77659_1_;
          }

          if (this.func_77875_a(p_77659_2_, var5, var7, var9, var13, var14, var15)
              && !p_77659_3_.field_71075_bZ.field_75098_d) {
            return new ItemStack(Item.field_77788_aw);
          }
        }
      } else if (this.field_77876_a == 0 && var12.field_72308_g instanceof EntityCow) {
        return new ItemStack(Item.field_77771_aG);
      }

      return p_77659_1_;
    }
  }