private void func_21030_a(World world, int i, int j, int k, int l, int i1, int j1) {
    int k1 = world.getBlockMetadata(i, j, k);
    int l1 = 0;
    wiresProvidePower = false;
    boolean flag = world.isBlockIndirectlyGettingPowered(i, j, k);
    wiresProvidePower = true;
    if (flag) {
      l1 = 15;
    } else {
      for (int i2 = 0; i2 < 4; i2++) {
        int k2 = i;
        int i3 = k;
        if (i2 == 0) {
          k2--;
        }
        if (i2 == 1) {
          k2++;
        }
        if (i2 == 2) {
          i3--;
        }
        if (i2 == 3) {
          i3++;
        }
        if (k2 != l || j != i1 || i3 != j1) {
          l1 = getMaxCurrentStrength(world, k2, j, i3, l1);
        }
        if (world.isBlockOpaqueCube(k2, j, i3) && !world.isBlockOpaqueCube(i, j + 1, k)) {
          if (k2 != l || j + 1 != i1 || i3 != j1) {
            l1 = getMaxCurrentStrength(world, k2, j + 1, i3, l1);
          }
          continue;
        }
        if (!world.isBlockOpaqueCube(k2, j, i3) && (k2 != l || j - 1 != i1 || i3 != j1)) {
          l1 = getMaxCurrentStrength(world, k2, j - 1, i3, l1);
        }
      }

      if (l1 > 0) {
        l1--;
      } else {
        l1 = 0;
      }
    }
    if (k1 != l1) {
      world.field_1043_h = true;
      world.setBlockMetadataWithNotify(i, j, k, l1);
      world.markBlocksDirty(i, j, k, i, j, k);
      world.field_1043_h = false;
      for (int j2 = 0; j2 < 4; j2++) {
        int l2 = i;
        int j3 = k;
        int k3 = j - 1;
        if (j2 == 0) {
          l2--;
        }
        if (j2 == 1) {
          l2++;
        }
        if (j2 == 2) {
          j3--;
        }
        if (j2 == 3) {
          j3++;
        }
        if (world.isBlockOpaqueCube(l2, j, j3)) {
          k3 += 2;
        }
        int l3 = 0;
        l3 = getMaxCurrentStrength(world, l2, j, j3, -1);
        l1 = world.getBlockMetadata(i, j, k);
        if (l1 > 0) {
          l1--;
        }
        if (l3 >= 0 && l3 != l1) {
          func_21030_a(world, l2, j, j3, i, j, k);
        }
        l3 = getMaxCurrentStrength(world, l2, k3, j3, -1);
        l1 = world.getBlockMetadata(i, j, k);
        if (l1 > 0) {
          l1--;
        }
        if (l3 >= 0 && l3 != l1) {
          func_21030_a(world, l2, k3, j3, i, j, k);
        }
      }

      if (k1 == 0 || l1 == 0) {
        field_21031_b.add(new ChunkPosition(i, j, k));
        field_21031_b.add(new ChunkPosition(i - 1, j, k));
        field_21031_b.add(new ChunkPosition(i + 1, j, k));
        field_21031_b.add(new ChunkPosition(i, j - 1, k));
        field_21031_b.add(new ChunkPosition(i, j + 1, k));
        field_21031_b.add(new ChunkPosition(i, j, k - 1));
        field_21031_b.add(new ChunkPosition(i, j, k + 1));
      }
    }
  }