public void func_76603_b() {
    int var1 = this.func_76625_h();

    int var2;
    int var3;
    for (var2 = 0; var2 < 16; ++var2) {
      var3 = 0;

      while (var3 < 16) {
        this.field_76638_b[var2 + (var3 << 4)] = -999;
        int var4 = var1 + 16 - 1;

        while (true) {
          if (var4 > 0) {
            if (this.func_76596_b(var2, var4 - 1, var3) == 0) {
              --var4;
              continue;
            }

            this.field_76634_f[var3 << 4 | var2] = var4;
          }

          if (!this.field_76637_e.field_73011_w.field_76576_e) {
            var4 = 15;
            int var5 = var1 + 16 - 1;

            do {
              var4 -= this.func_76596_b(var2, var5, var3);
              if (var4 > 0) {
                ExtendedBlockStorage var6 = this.field_76652_q[var5 >> 4];
                if (var6 != null) {
                  var6.func_76657_c(var2, var5 & 15, var3, var4);
                  this.field_76637_e.func_72902_n(
                      (this.field_76635_g << 4) + var2, var5, (this.field_76647_h << 4) + var3);
                }
              }

              --var5;
            } while (var5 > 0 && var4 > 0);
          }

          ++var3;
          break;
        }
      }
    }

    this.field_76643_l = true;

    for (var2 = 0; var2 < 16; ++var2) {
      for (var3 = 0; var3 < 16; ++var3) {
        this.func_76595_e(var2, var3);
      }
    }
  }
  public void func_76633_a(
      EnumSkyBlock p_76633_1_, int p_76633_2_, int p_76633_3_, int p_76633_4_, int p_76633_5_) {
    ExtendedBlockStorage var6 = this.field_76652_q[p_76633_3_ >> 4];
    if (var6 == null) {
      var6 = this.field_76652_q[p_76633_3_ >> 4] = new ExtendedBlockStorage(p_76633_3_ >> 4 << 4);
      this.func_76603_b();
    }

    this.field_76643_l = true;
    if (p_76633_1_ == EnumSkyBlock.Sky) {
      if (!this.field_76637_e.field_73011_w.field_76576_e) {
        var6.func_76657_c(p_76633_2_, p_76633_3_ & 15, p_76633_4_, p_76633_5_);
      }
    } else if (p_76633_1_ == EnumSkyBlock.Block) {
      var6.func_76677_d(p_76633_2_, p_76633_3_ & 15, p_76633_4_, p_76633_5_);
    }
  }
  private void func_76615_h(int p_76615_1_, int p_76615_2_, int p_76615_3_) {
    int var4 = this.field_76634_f[p_76615_3_ << 4 | p_76615_1_] & 255;
    int var5 = var4;
    if (p_76615_2_ > var4) {
      var5 = p_76615_2_;
    }

    while (var5 > 0 && this.func_76596_b(p_76615_1_, var5 - 1, p_76615_3_) == 0) {
      --var5;
    }

    if (var5 != var4) {
      this.field_76637_e.func_72975_g(
          p_76615_1_ + this.field_76635_g * 16, p_76615_3_ + this.field_76647_h * 16, var5, var4);
      this.field_76634_f[p_76615_3_ << 4 | p_76615_1_] = var5;
      int var6 = this.field_76635_g * 16 + p_76615_1_;
      int var7 = this.field_76647_h * 16 + p_76615_3_;
      int var8;
      int var12;
      if (!this.field_76637_e.field_73011_w.field_76576_e) {
        ExtendedBlockStorage var9;
        if (var5 < var4) {
          for (var8 = var5; var8 < var4; ++var8) {
            var9 = this.field_76652_q[var8 >> 4];
            if (var9 != null) {
              var9.func_76657_c(p_76615_1_, var8 & 15, p_76615_3_, 15);
              this.field_76637_e.func_72902_n(
                  (this.field_76635_g << 4) + p_76615_1_,
                  var8,
                  (this.field_76647_h << 4) + p_76615_3_);
            }
          }
        } else {
          for (var8 = var4; var8 < var5; ++var8) {
            var9 = this.field_76652_q[var8 >> 4];
            if (var9 != null) {
              var9.func_76657_c(p_76615_1_, var8 & 15, p_76615_3_, 0);
              this.field_76637_e.func_72902_n(
                  (this.field_76635_g << 4) + p_76615_1_,
                  var8,
                  (this.field_76647_h << 4) + p_76615_3_);
            }
          }
        }

        var8 = 15;

        while (var5 > 0 && var8 > 0) {
          --var5;
          var12 = this.func_76596_b(p_76615_1_, var5, p_76615_3_);
          if (var12 == 0) {
            var12 = 1;
          }

          var8 -= var12;
          if (var8 < 0) {
            var8 = 0;
          }

          ExtendedBlockStorage var10 = this.field_76652_q[var5 >> 4];
          if (var10 != null) {
            var10.func_76657_c(p_76615_1_, var5 & 15, p_76615_3_, var8);
          }
        }
      }

      var8 = this.field_76634_f[p_76615_3_ << 4 | p_76615_1_];
      var12 = var4;
      int var13 = var8;
      if (var8 < var4) {
        var12 = var8;
        var13 = var4;
      }

      if (!this.field_76637_e.field_73011_w.field_76576_e) {
        this.func_76609_d(var6 - 1, var7, var12, var13);
        this.func_76609_d(var6 + 1, var7, var12, var13);
        this.func_76609_d(var6, var7 - 1, var12, var13);
        this.func_76609_d(var6, var7 + 1, var12, var13);
        this.func_76609_d(var6, var7, var12, var13);
      }

      this.field_76643_l = true;
    }
  }