Program: 33997
Project: 33997
Buggy source:
/** 
 * This calculates the value of a horizontal slice of island space. It may be 255 to 0, or it may be smaller. The larger the island area, the smaller the slice. This keeps the per-tick time low enough not to cause lag.
 * @param top
 * @param bottom
 */
private void calculateSlice(int top,int bottom){
  if (bottom < 0) {
    bottom=0;
  }
  int r=range / 2;
  for (int y=top; y >= bottom; y--) {
    for (int x=px - r; x <= px + r; x++) {
      for (int z=pz - r; z <= pz + r; z++) {
        Material blockType=l.getWorld().getBlockAt(x,y,z).getType();
        byte data=l.getWorld().getBlockAt(x,y,z).getData();
        MaterialData md=new MaterialData(blockType);
        md.setData(data);
        MaterialData generic=new MaterialData(blockType);
        if (blockType != Material.AIR) {
          if (limitCount.containsKey(md) && Settings.blockValues.containsKey(md)) {
            int count=limitCount.get(md);
            if (count > 0) {
              limitCount.put(md,--count);
              if (y < Settings.sea_level) {
                underWaterBlockCount+=Settings.blockValues.get(md);
              }
 else {
                blockCount+=Settings.blockValues.get(md);
              }
            }
          }
 else           if (limitCount.containsKey(generic) && Settings.blockValues.containsKey(generic)) {
            int count=limitCount.get(generic);
            if (count > 0) {
              limitCount.put(md,--count);
              if (y < Settings.sea_level) {
                underWaterBlockCount+=Settings.blockValues.get(generic);
              }
 else {
                blockCount+=Settings.blockValues.get(generic);
              }
            }
          }
 else           if (Settings.blockValues.containsKey(md)) {
            if (y < Settings.sea_level) {
              underWaterBlockCount+=Settings.blockValues.get(md);
            }
 else {
              blockCount+=Settings.blockValues.get(md);
            }
          }
 else           if (Settings.blockValues.containsKey(generic)) {
            if (y < Settings.sea_level) {
              underWaterBlockCount+=Settings.blockValues.get(generic);
            }
 else {
              blockCount+=Settings.blockValues.get(generic);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This calculates the value of a horizontal slice of island space. It may be 255 to 0, or it may be smaller. The larger the island area, the smaller the slice. This keeps the per-tick time low enough not to cause lag.
 * @param top
 * @param bottom
 */
private void calculateSlice(int top,int bottom){
  if (bottom < 0) {
    bottom=0;
  }
  int r=range / 2;
  for (int y=top; y >= bottom; y--) {
    for (int x=px - r; x <= px + r; x++) {
      for (int z=pz - r; z <= pz + r; z++) {
        Material blockType=l.getWorld().getBlockAt(x,y,z).getType();
        byte data=l.getWorld().getBlockAt(x,y,z).getData();
        MaterialData md=new MaterialData(blockType);
        md.setData(data);
        MaterialData generic=new MaterialData(blockType);
        if (blockType != Material.AIR) {
          if (limitCount.containsKey(md) && Settings.blockValues.containsKey(md)) {
            int count=limitCount.get(md);
            if (count > 0) {
              limitCount.put(md,--count);
              if (y <= Settings.sea_level) {
                underWaterBlockCount+=Settings.blockValues.get(md);
              }
 else {
                blockCount+=Settings.blockValues.get(md);
              }
            }
          }
 else           if (limitCount.containsKey(generic) && Settings.blockValues.containsKey(generic)) {
            int count=limitCount.get(generic);
            if (count > 0) {
              limitCount.put(md,--count);
              if (y <= Settings.sea_level) {
                underWaterBlockCount+=Settings.blockValues.get(generic);
              }
 else {
                blockCount+=Settings.blockValues.get(generic);
              }
            }
          }
 else           if (Settings.blockValues.containsKey(md)) {
            if (y <= Settings.sea_level) {
              underWaterBlockCount+=Settings.blockValues.get(md);
            }
 else {
              blockCount+=Settings.blockValues.get(md);
            }
          }
 else           if (Settings.blockValues.containsKey(generic)) {
            if (y <= Settings.sea_level) {
              underWaterBlockCount+=Settings.blockValues.get(generic);
            }
 else {
              blockCount+=Settings.blockValues.get(generic);
            }
          }
        }
      }
    }
  }
}