Program: 156653
Project: 156653
Buggy source:
/** 
 * Dig the next available piece of land if not done. As soon as it reaches bedrock, lava or goes below 0, it's considered done. 
 */
@Override public void update(){
  super.update();
  if (worldObj.isRemote) {
    return;
  }
  if (updateTracker.markTimeIfDelay(worldObj)) {
    sendNetworkUpdate();
  }
  ticksSinceAction++;
  if (mode == Mode.Off) {
    if (miner != null) {
      miner.invalidate();
      miner=null;
    }
    isDigging=false;
    return;
  }
  if (getBattery().getEnergyStored() == 0) {
    return;
  }
  if (miner == null) {
    World world=worldObj;
    int depth=pos.getY() - 1;
    while (world.getBlockState(xCoord,depth,zCoord) == BuildCraftFactory.plainPipeBlock) {
      depth=depth - 1;
    }
    if (depth < 1 || depth < yCoord - BuildCraftFactory.miningDepth || !BlockUtils.canChangeBlock(world,xCoord,depth,zCoord)) {
      isDigging=false;
      getBattery().useEnergy(0,10,false);
      return;
    }
    if (world.isAirBlock(xCoord,depth,zCoord) || world.getBlock(xCoord,depth,zCoord).isReplaceable(world,xCoord,depth,zCoord)) {
      ticksSinceAction=0;
      world.setBlock(xCoord,depth,zCoord,BuildCraftFactory.plainPipeBlock);
    }
 else {
      miner=new BlockMiner(world,this,xCoord,depth,zCoord);
    }
  }
  if (miner != null) {
    isDigging=true;
    ticksSinceAction=0;
    int usedEnergy=miner.acceptEnergy(getBattery().getEnergyStored());
    getBattery().useEnergy(usedEnergy,usedEnergy,false);
    if (miner.hasMined()) {
      if (miner.hasFailed()) {
        isDigging=false;
      }
      miner=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Dig the next available piece of land if not done. As soon as it reaches bedrock, lava or goes below 0, it's considered done. 
 */
@Override public void update(){
  super.update();
  if (worldObj.isRemote) {
    return;
  }
  if (updateTracker.markTimeIfDelay(worldObj)) {
    sendNetworkUpdate();
  }
  ticksSinceAction++;
  if (mode == Mode.Off) {
    if (miner != null) {
      miner.invalidate();
      miner=null;
    }
    isDigging=false;
    return;
  }
  if (getBattery().getEnergyStored() == 0) {
    return;
  }
  if (miner == null) {
    World world=worldObj;
    BlockPos search=pos.down();
    while (world.getBlockState(search).getBlock() == BuildCraftFactory.plainPipeBlock) {
      search=search.down();
    }
    if (search.getY() < 1 || search.getY() < pos.getY() - BuildCraftFactory.miningDepth || !BlockUtils.canChangeBlock(world,search)) {
      isDigging=false;
      getBattery().useEnergy(0,10,false);
      return;
    }
    if (world.isAirBlock(search) || world.getBlockState(search).getBlock().isReplaceable(world,search)) {
      ticksSinceAction=0;
      world.setBlockState(search,BuildCraftFactory.plainPipeBlock.getDefaultState());
    }
 else {
      miner=new BlockMiner(world,this,search);
    }
  }
  if (miner != null) {
    isDigging=true;
    ticksSinceAction=0;
    int usedEnergy=miner.acceptEnergy(getBattery().getEnergyStored());
    getBattery().useEnergy(usedEnergy,usedEnergy,false);
    if (miner.hasMined()) {
      if (miner.hasFailed()) {
        isDigging=false;
      }
      miner=null;
    }
  }
}