Program: 8280
Project: 8280
Buggy source:
/** 
 * Called by multiple tools' left click function. Charge has no effect. Free operation.
 */
protected void digBasedOnMode(ItemStack stack,World world,Block block,int x,int y,int z,EntityLivingBase living){
  if (world.isRemote || !(living instanceof EntityPlayer)) {
    return;
  }
  EntityPlayer player=(EntityPlayer)living;
  byte mode=this.getMode(stack);
  if (mode == 0) {
    return;
  }
  MovingObjectPosition mop=this.getMovingObjectPositionFromPlayer(world,player,false);
  AxisAlignedBB box;
  if (mop == null || mop.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
    return;
  }
  ForgeDirection direction=ForgeDirection.getOrientation(mop.sideHit);
  if (mode == 1) {
    box=AxisAlignedBB.getBoundingBox(x,y - 1,z,x,y + 1,z);
  }
 else   if (mode == 2) {
    if (direction.offsetX != 0) {
      box=AxisAlignedBB.getBoundingBox(x,y,z - 1,x,y,z + 1);
    }
 else     if (direction.offsetZ != 0) {
      box=AxisAlignedBB.getBoundingBox(x - 1,y,z,x + 1,y,z);
    }
 else {
      int dir=MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
      if (dir == 0 || dir == 2) {
        box=AxisAlignedBB.getBoundingBox(x,y,z - 1,x,y,z + 1);
      }
 else {
        box=AxisAlignedBB.getBoundingBox(x - 1,y,z,x + 1,y,z);
      }
    }
  }
 else {
    if (direction.offsetX == 1) {
      box=AxisAlignedBB.getBoundingBox(x - 2,y,z,x,y,z);
    }
 else     if (direction.offsetX == -1) {
      box=AxisAlignedBB.getBoundingBox(x,y,z,x + 2,y,z);
    }
 else     if (direction.offsetZ == 1) {
      box=AxisAlignedBB.getBoundingBox(x,y,z - 2,x,y,z);
    }
 else     if (direction.offsetZ == -1) {
      box=AxisAlignedBB.getBoundingBox(x,y,z,x,y,z + 2);
    }
 else     if (direction.offsetY == 1) {
      box=AxisAlignedBB.getBoundingBox(x,y - 2,z,x,y,z);
    }
 else {
      box=AxisAlignedBB.getBoundingBox(x,y,z,x,y + 2,z);
    }
  }
  List<ItemStack> drops=Lists.newArrayList();
  for (int i=(int)box.minX; i <= box.maxX; i++)   for (int j=(int)box.minY; j <= box.maxY; j++)   for (int k=(int)box.minZ; k <= box.maxZ; k++) {
    Block b=world.getBlock(i,j,k);
    if (PlayerHelper.hasBreakPermission(world,((EntityPlayerMP)player),x,y,z) && b != Blocks.air && b.getBlockHardness(world,i,j,k) != -1 && (canHarvestBlock(block,stack) || ForgeHooks.canToolHarvestBlock(block,world.getBlockMetadata(i,j,k),stack))) {
      drops.addAll(WorldHelper.getBlockDrops(world,player,b,stack,i,j,k));
      world.setBlockToAir(i,j,k);
    }
  }
  WorldHelper.createLootDrop(drops,world,x,y,z);
}

Fixed version (ground truth):
/** 
 * Called by multiple tools' left click function. Charge has no effect. Free operation.
 */
protected void digBasedOnMode(ItemStack stack,World world,Block block,int x,int y,int z,EntityLivingBase living){
  if (world.isRemote || !(living instanceof EntityPlayer)) {
    return;
  }
  EntityPlayer player=(EntityPlayer)living;
  byte mode=this.getMode(stack);
  if (mode == 0) {
    return;
  }
  MovingObjectPosition mop=this.getMovingObjectPositionFromPlayer(world,player,false);
  AxisAlignedBB box;
  if (mop == null || mop.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
    return;
  }
  ForgeDirection direction=ForgeDirection.getOrientation(mop.sideHit);
  if (mode == 1) {
    box=AxisAlignedBB.getBoundingBox(x,y - 1,z,x,y + 1,z);
  }
 else   if (mode == 2) {
    if (direction.offsetX != 0) {
      box=AxisAlignedBB.getBoundingBox(x,y,z - 1,x,y,z + 1);
    }
 else     if (direction.offsetZ != 0) {
      box=AxisAlignedBB.getBoundingBox(x - 1,y,z,x + 1,y,z);
    }
 else {
      int dir=MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
      if (dir == 0 || dir == 2) {
        box=AxisAlignedBB.getBoundingBox(x,y,z - 1,x,y,z + 1);
      }
 else {
        box=AxisAlignedBB.getBoundingBox(x - 1,y,z,x + 1,y,z);
      }
    }
  }
 else {
    if (direction.offsetX == 1) {
      box=AxisAlignedBB.getBoundingBox(x - 2,y,z,x,y,z);
    }
 else     if (direction.offsetX == -1) {
      box=AxisAlignedBB.getBoundingBox(x,y,z,x + 2,y,z);
    }
 else     if (direction.offsetZ == 1) {
      box=AxisAlignedBB.getBoundingBox(x,y,z - 2,x,y,z);
    }
 else     if (direction.offsetZ == -1) {
      box=AxisAlignedBB.getBoundingBox(x,y,z,x,y,z + 2);
    }
 else     if (direction.offsetY == 1) {
      box=AxisAlignedBB.getBoundingBox(x,y - 2,z,x,y,z);
    }
 else {
      box=AxisAlignedBB.getBoundingBox(x,y,z,x,y + 2,z);
    }
  }
  List<ItemStack> drops=Lists.newArrayList();
  for (int i=(int)box.minX; i <= box.maxX; i++)   for (int j=(int)box.minY; j <= box.maxY; j++)   for (int k=(int)box.minZ; k <= box.maxZ; k++) {
    Block b=world.getBlock(i,j,k);
    if (b != Blocks.air && b.getBlockHardness(world,i,j,k) != -1 && PlayerHelper.hasBreakPermission(((EntityPlayerMP)player),x,y,z) && (canHarvestBlock(block,stack) || ForgeHooks.canToolHarvestBlock(block,world.getBlockMetadata(i,j,k),stack))) {
      drops.addAll(WorldHelper.getBlockDrops(world,player,b,stack,i,j,k));
      world.setBlockToAir(i,j,k);
    }
  }
  WorldHelper.createLootDrop(drops,world,x,y,z);
}