public boolean func_76589_b(int p_76589_1_, int p_76589_2_, int p_76589_3_, int p_76589_4_) {
    ExtendedBlockStorage var5 = this.field_76652_q[p_76589_2_ >> 4];
    if (var5 == null) {
      return false;
    } else {
      int var6 = var5.func_76665_b(p_76589_1_, p_76589_2_ & 15, p_76589_3_);
      if (var6 == p_76589_4_) {
        return false;
      } else {
        this.field_76643_l = true;
        var5.func_76654_b(p_76589_1_, p_76589_2_ & 15, p_76589_3_, p_76589_4_);
        int var7 = var5.func_76656_a(p_76589_1_, p_76589_2_ & 15, p_76589_3_);
        if (var7 > 0 && Block.field_71973_m[var7] instanceof BlockContainer) {
          TileEntity var8 = this.func_76597_e(p_76589_1_, p_76589_2_, p_76589_3_);
          if (var8 != null) {
            var8.func_70321_h();
            var8.field_70325_p = p_76589_4_;
          }
        }

        return true;
      }
    }
  }
  public boolean func_76592_a(
      int p_76592_1_, int p_76592_2_, int p_76592_3_, int p_76592_4_, int p_76592_5_) {
    int var6 = p_76592_3_ << 4 | p_76592_1_;
    if (p_76592_2_ >= this.field_76638_b[var6] - 1) {
      this.field_76638_b[var6] = -999;
    }

    int var7 = this.field_76634_f[var6];
    int var8 = this.func_76610_a(p_76592_1_, p_76592_2_, p_76592_3_);
    int var9 = this.func_76628_c(p_76592_1_, p_76592_2_, p_76592_3_);
    if (var8 == p_76592_4_ && var9 == p_76592_5_) {
      return false;
    } else {
      ExtendedBlockStorage var10 = this.field_76652_q[p_76592_2_ >> 4];
      boolean var11 = false;
      if (var10 == null) {
        if (p_76592_4_ == 0) {
          return false;
        }

        var10 =
            this.field_76652_q[p_76592_2_ >> 4] = new ExtendedBlockStorage(p_76592_2_ >> 4 << 4);
        var11 = p_76592_2_ >= var7;
      }

      int var12 = this.field_76635_g * 16 + p_76592_1_;
      int var13 = this.field_76647_h * 16 + p_76592_3_;
      if (var8 != 0 && !this.field_76637_e.field_72995_K) {
        Block.field_71973_m[var8].func_71927_h(this.field_76637_e, var12, p_76592_2_, var13, var9);
      }

      var10.func_76655_a(p_76592_1_, p_76592_2_ & 15, p_76592_3_, p_76592_4_);
      if (var8 != 0) {
        if (!this.field_76637_e.field_72995_K) {
          Block.field_71973_m[var8].func_71852_a(
              this.field_76637_e, var12, p_76592_2_, var13, var8, var9);
        } else if (Block.field_71973_m[var8] instanceof BlockContainer && var8 != p_76592_4_) {
          this.field_76637_e.func_72932_q(var12, p_76592_2_, var13);
        }
      }

      if (var10.func_76656_a(p_76592_1_, p_76592_2_ & 15, p_76592_3_) != p_76592_4_) {
        return false;
      } else {
        var10.func_76654_b(p_76592_1_, p_76592_2_ & 15, p_76592_3_, p_76592_5_);
        if (var11) {
          this.func_76603_b();
        } else {
          if (Block.field_71971_o[p_76592_4_ & 4095] > 0) {
            if (p_76592_2_ >= var7) {
              this.func_76615_h(p_76592_1_, p_76592_2_ + 1, p_76592_3_);
            }
          } else if (p_76592_2_ == var7 - 1) {
            this.func_76615_h(p_76592_1_, p_76592_2_, p_76592_3_);
          }

          this.func_76595_e(p_76592_1_, p_76592_3_);
        }

        TileEntity var14;
        if (p_76592_4_ != 0) {
          if (!this.field_76637_e.field_72995_K) {
            Block.field_71973_m[p_76592_4_].func_71861_g(
                this.field_76637_e, var12, p_76592_2_, var13);
          }

          if (Block.field_71973_m[p_76592_4_] instanceof BlockContainer) {
            var14 = this.func_76597_e(p_76592_1_, p_76592_2_, p_76592_3_);
            if (var14 == null) {
              var14 =
                  ((BlockContainer) Block.field_71973_m[p_76592_4_])
                      .func_72274_a(this.field_76637_e);
              this.field_76637_e.func_72837_a(var12, p_76592_2_, var13, var14);
            }

            if (var14 != null) {
              var14.func_70321_h();
            }
          }
        } else if (var8 > 0 && Block.field_71973_m[var8] instanceof BlockContainer) {
          var14 = this.func_76597_e(p_76592_1_, p_76592_2_, p_76592_3_);
          if (var14 != null) {
            var14.func_70321_h();
          }
        }

        this.field_76643_l = true;
        return true;
      }
    }
  }