Ejemplo n.º 1
0
 public void func_71860_a(
     World p_71860_1_, int p_71860_2_, int p_71860_3_, int p_71860_4_, EntityLiving p_71860_5_) {
   int i = p_71860_1_.func_72798_a(p_71860_2_, p_71860_3_, p_71860_4_ - 1);
   int j = p_71860_1_.func_72798_a(p_71860_2_, p_71860_3_, p_71860_4_ + 1);
   int k = p_71860_1_.func_72798_a(p_71860_2_ - 1, p_71860_3_, p_71860_4_);
   int l = p_71860_1_.func_72798_a(p_71860_2_ + 1, p_71860_3_, p_71860_4_);
   byte byte0 = 0;
   int i1 = MathHelper.func_76128_c((double) ((p_71860_5_.field_70177_z * 4F) / 360F) + 0.5D) & 3;
   if (i1 == 0) {
     byte0 = 2;
   }
   if (i1 == 1) {
     byte0 = 5;
   }
   if (i1 == 2) {
     byte0 = 3;
   }
   if (i1 == 3) {
     byte0 = 4;
   }
   if (i != field_71990_ca && j != field_71990_ca && k != field_71990_ca && l != field_71990_ca) {
     p_71860_1_.func_72921_c(p_71860_2_, p_71860_3_, p_71860_4_, byte0);
   } else {
     if ((i == field_71990_ca || j == field_71990_ca) && (byte0 == 4 || byte0 == 5)) {
       if (i == field_71990_ca) {
         p_71860_1_.func_72921_c(p_71860_2_, p_71860_3_, p_71860_4_ - 1, byte0);
       } else {
         p_71860_1_.func_72921_c(p_71860_2_, p_71860_3_, p_71860_4_ + 1, byte0);
       }
       p_71860_1_.func_72921_c(p_71860_2_, p_71860_3_, p_71860_4_, byte0);
     }
     if ((k == field_71990_ca || l == field_71990_ca) && (byte0 == 2 || byte0 == 3)) {
       if (k == field_71990_ca) {
         p_71860_1_.func_72921_c(p_71860_2_ - 1, p_71860_3_, p_71860_4_, byte0);
       } else {
         p_71860_1_.func_72921_c(p_71860_2_ + 1, p_71860_3_, p_71860_4_, byte0);
       }
       p_71860_1_.func_72921_c(p_71860_2_, p_71860_3_, p_71860_4_, byte0);
     }
   }
 }
Ejemplo n.º 2
0
  public void func_77278_a() {
    float f = field_77280_f;
    HashSet hashset = new HashSet();
    for (int i = 0; i < field_77289_h; i++) {
      for (int k = 0; k < field_77289_h; k++) {
        label0:
        for (int i1 = 0; i1 < field_77289_h; i1++) {
          if (i != 0
              && i != field_77289_h - 1
              && k != 0
              && k != field_77289_h - 1
              && i1 != 0
              && i1 != field_77289_h - 1) {
            continue;
          }
          double d = ((float) i / ((float) field_77289_h - 1.0F)) * 2.0F - 1.0F;
          double d1 = ((float) k / ((float) field_77289_h - 1.0F)) * 2.0F - 1.0F;
          double d2 = ((float) i1 / ((float) field_77289_h - 1.0F)) * 2.0F - 1.0F;
          double d3 = Math.sqrt(d * d + d1 * d1 + d2 * d2);
          d /= d3;
          d1 /= d3;
          d2 /= d3;
          float f1 = field_77280_f * (0.7F + field_77287_j.field_73012_v.nextFloat() * 0.6F);
          double d5 = field_77284_b;
          double d7 = field_77285_c;
          double d9 = field_77282_d;
          float f2 = 0.3F;
          do {
            if (f1 <= 0.0F) {
              continue label0;
            }
            int k2 = MathHelper.func_76128_c(d5);
            int l2 = MathHelper.func_76128_c(d7);
            int i3 = MathHelper.func_76128_c(d9);
            int j3 = field_77287_j.func_72798_a(k2, l2, i3);
            if (j3 > 0) {
              f1 -= (Block.field_71973_m[j3].func_71904_a(field_77283_e) + 0.3F) * f2;
            }
            if (f1 > 0.0F) {
              hashset.add(new ChunkPosition(k2, l2, i3));
            }
            d5 += d * (double) f2;
            d7 += d1 * (double) f2;
            d9 += d2 * (double) f2;
            f1 -= f2 * 0.75F;
          } while (true);
        }
      }
    }

    field_77281_g.addAll(hashset);
    field_77280_f *= 2.0F;
    int j = MathHelper.func_76128_c(field_77284_b - (double) field_77280_f - 1.0D);
    int l = MathHelper.func_76128_c(field_77284_b + (double) field_77280_f + 1.0D);
    int j1 = MathHelper.func_76128_c(field_77285_c - (double) field_77280_f - 1.0D);
    int k1 = MathHelper.func_76128_c(field_77285_c + (double) field_77280_f + 1.0D);
    int l1 = MathHelper.func_76128_c(field_77282_d - (double) field_77280_f - 1.0D);
    int i2 = MathHelper.func_76128_c(field_77282_d + (double) field_77280_f + 1.0D);
    List list =
        field_77287_j.func_72839_b(
            field_77283_e, AxisAlignedBB.func_72332_a().func_72299_a(j, j1, l1, l, k1, i2));
    Vec3 vec3 = Vec3.func_72437_a().func_72345_a(field_77284_b, field_77285_c, field_77282_d);
    for (int j2 = 0; j2 < list.size(); j2++) {
      Entity entity = (Entity) list.get(j2);
      double d4 =
          entity.func_70011_f(field_77284_b, field_77285_c, field_77282_d) / (double) field_77280_f;
      if (d4 > 1.0D) {
        continue;
      }
      double d6 = entity.field_70165_t - field_77284_b;
      double d8 = (entity.field_70163_u + (double) entity.func_70047_e()) - field_77285_c;
      double d10 = entity.field_70161_v - field_77282_d;
      double d11 = MathHelper.func_76133_a(d6 * d6 + d8 * d8 + d10 * d10);
      if (d11 == 0.0D) {
        continue;
      }
      d6 /= d11;
      d8 /= d11;
      d10 /= d11;
      double d12 = field_77287_j.func_72842_a(vec3, entity.field_70121_D);
      double d13 = (1.0D - d4) * d12;
      entity.func_70097_a(
          DamageSource.field_76378_k,
          (int) (((d13 * d13 + d13) / 2D) * 8D * (double) field_77280_f + 1.0D));
      entity.field_70159_w += d6 * d13;
      entity.field_70181_x += d8 * d13;
      entity.field_70179_y += d10 * d13;
      if (entity instanceof EntityPlayer) {
        field_77288_k.put(
            (EntityPlayer) entity, Vec3.func_72437_a().func_72345_a(d6 * d13, d8 * d13, d10 * d13));
      }
    }

    field_77280_f = f;
  }