Program: 58176
Project: 58176
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public short[][] generateExtBlockSections(World world,Random random,int cx,int cz,BiomeGrid biomes){
  int maxY=world.getMaxHeight();
  result=new short[maxY / 16][];
  double pathWidthLower;
  pathWidthLower=Math.floor(pathsize / 2);
  if (cx < 0)   cx+=((-cx) * (size));
  if (cz < 0)   cz+=((-cz) * (size));
  double absX=(cx * 16 + 16 - pathWidthLower - 1 + 8 * size);
  double absZ=(cz * 16 + 16 - pathWidthLower - 1 + 8 * size);
  double plotMinX=(((absX) % size));
  double plotMinZ=(((absZ) % size));
  double roadStartX=(plotMinX + pathsize);
  double roadStartZ=(plotMinZ + pathsize);
  if (roadStartX >= size)   roadStartX-=size;
  if (roadStartZ >= size)   roadStartZ-=size;
  for (int x=0; x < 16; x++) {
    for (int z=0; z < 16; z++) {
      setBlock(result,x,0,z,bottom);
      biomes.setBiome(x,z,biome);
    }
  }
  if (plotMinZ + 1 <= 16 || roadStartZ <= 16 && roadStartZ > 0) {
    int start=(int)Math.max(16 - plotMinZ - pathsize + 1,16 - roadStartZ + 1);
    int end=(int)Math.min(16 - plotMinZ - 1,16 - roadStartZ + pathsize);
    if (start >= 0 && start <= 16 && end < 0)     end=16;
    setCuboidRegion(0,16,1,roadheight + 1,Math.max(start,0),Math.min(16,end),floor1);
  }
  if (plotMinX + 1 <= 16 || roadStartX <= 16 && roadStartX > 0) {
    int start=(int)Math.max(16 - plotMinX - pathsize + 1,16 - roadStartX + 1);
    int end=(int)Math.min(16 - plotMinX - 1,16 - roadStartX + pathsize);
    if (start >= 0 && start <= 16 && end < 0)     end=16;
    setCuboidRegion(Math.max(start,0),Math.min(16,end),1,roadheight + 1,0,16,floor1);
  }
  if (plotsize > 16) {
    if (roadStartX <= 16) {
      if (roadStartZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
      if (plotMinZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
    }
 else {
      if (roadStartZ <= 16) {
        if (plotMinX > 16) {
          setCuboidRegion(0,16,1,plotheight,0,16 - roadStartZ,getFilling(random));
          setCuboidRegion(0,16,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
        }
      }
    }
    if (plotMinX <= 16) {
      if (plotMinZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
 else {
        int z=(int)(16 - roadStartZ);
        if (z < 0)         z=16;
        setCuboidRegion(16 - plotMinX,16,1,plotheight,0,z,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,0,z,getPlotFloor(random));
      }
      if (roadStartZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
 else {
        if (roadStartX <= 16) {
          if (plotMinZ > 16) {
            int x=(int)(16 - roadStartX);
            if (x < 0)             x=16;
            setCuboidRegion(0,x,1,plotheight,0,16,getFilling(random));
            setCuboidRegion(0,x,plotheight,plotheight + 1,0,16,getPlotFloor(random));
          }
        }
      }
    }
 else {
      if (plotMinZ <= 16) {
        if (roadStartX > 16) {
          int x=(int)(16 - roadStartX);
          if (x < 0)           x=16;
          setCuboidRegion(0,x,1,plotheight,16 - plotMinZ,16,getFilling(random));
          setCuboidRegion(0,x,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
        }
      }
 else {
        if (roadStartZ > 16) {
          int x=(int)(16 - roadStartX);
          if (x < 0)           x=16;
          int z=(int)(16 - roadStartZ);
          if (z < 0)           z=16;
          if (roadStartX > 16) {
            setCuboidRegion(0,x,1,plotheight,0,z,getFilling(random));
            setCuboidRegion(0,x,plotheight,plotheight + 1,0,z,getPlotFloor(random));
          }
 else {
            setCuboidRegion(0,x,1,plotheight,0,z,getFilling(random));
            setCuboidRegion(0,x,plotheight,plotheight + 1,0,z,getPlotFloor(random));
          }
        }
      }
    }
  }
 else {
    if (roadStartX <= 16) {
      if (roadStartZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
      if (plotMinZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
    }
    if (plotMinX <= 16) {
      if (plotMinZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
      if (roadStartZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
    }
  }
  if (plotMinZ + 1 <= 16) {
    double start, end;
    if (plotMinX + 2 <= 16)     start=16 - plotMinX - 1;
 else     start=16;
    if (roadStartX - 1 <= 16)     end=16 - roadStartX + 1;
 else     end=0;
    if (!(plotMinX + 2 <= 16 || roadStartX - 1 <= 16)) {
      start=0;
    }
    setCuboidRegion(0,end,1,wallheight + 1,16 - plotMinZ - 1,16 - plotMinZ,wallfilling);
    setCuboidRegion(0,end,wallheight + 1,wallheight + 2,16 - plotMinZ - 1,16 - plotMinZ,wall);
    setCuboidRegion(start,16,1,wallheight + 1,16 - plotMinZ - 1,16 - plotMinZ,wallfilling);
    setCuboidRegion(start,16,wallheight + 1,wallheight + 2,16 - plotMinZ - 1,16 - plotMinZ,wall);
  }
  if (plotMinX + 1 <= 16) {
    double start, end;
    if (plotMinZ + 2 <= 16)     start=16 - plotMinZ - 1;
 else     start=16;
    if (roadStartZ - 1 <= 16)     end=16 - roadStartZ + 1;
 else     end=0;
    if (!(plotMinZ + 2 <= 16 || roadStartZ - 1 <= 16)) {
      start=0;
    }
    setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,1,wallheight + 1,0,end,wallfilling);
    setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,wallheight + 1,wallheight + 2,0,end,wall);
    setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,1,wallheight + 1,start,16,wallfilling);
    setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,wallheight + 1,wallheight + 2,start,16,wall);
  }
  if (roadStartZ <= 16 && roadStartZ > 0) {
    double start, end;
    if (plotMinX + 1 <= 16)     start=16 - plotMinX;
 else     start=16;
    if (roadStartX <= 16)     end=16 - roadStartX;
 else     end=0;
    if (!(plotMinX + 1 <= 16 || roadStartX <= 16)) {
      start=0;
    }
    setCuboidRegion(0,end,1,wallheight + 1,16 - roadStartZ,16 - roadStartZ + 1,wallfilling);
    setCuboidRegion(0,end,wallheight + 1,wallheight + 2,16 - roadStartZ,16 - roadStartZ + 1,wall);
    setCuboidRegion(start,16,1,wallheight + 1,16 - roadStartZ,16 - roadStartZ + 1,wallfilling);
    setCuboidRegion(start,16,wallheight + 1,wallheight + 2,16 - roadStartZ,16 - roadStartZ + 1,wall);
  }
  if (roadStartX <= 16 && roadStartX > 0) {
    double start, end;
    if (plotMinZ + 1 <= 16)     start=16 - plotMinZ;
 else     start=16;
    if (roadStartZ + 1 <= 16)     end=16 - roadStartZ + 1;
 else     end=0;
    if (!(plotMinZ + 1 <= 16 || roadStartZ + 1 <= 16)) {
      start=0;
    }
    setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,1,wallheight + 1,0,end,wallfilling);
    setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,wallheight + 1,roadheight + 2,0,end,wall);
    setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,1,wallheight + 1,start,16,wallfilling);
    setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,wallheight + 1,wallheight + 2,start,16,wall);
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public short[][] generateExtBlockSections(World world,Random random,int cx,int cz,BiomeGrid biomes){
  int maxY=world.getMaxHeight();
  result=new short[maxY / 16][];
  double pathWidthLower;
  pathWidthLower=Math.floor(pathsize / 2);
  if (cx < 0)   cx+=((-cx) * (size));
  if (cz < 0)   cz+=((-cz) * (size));
  double absX=(cx * 16 + 16 - pathWidthLower - 1 + 8 * size);
  double absZ=(cz * 16 + 16 - pathWidthLower - 1 + 8 * size);
  double plotMinX=(((absX) % size));
  double plotMinZ=(((absZ) % size));
  double roadStartX=(plotMinX + pathsize);
  double roadStartZ=(plotMinZ + pathsize);
  if (roadStartX >= size)   roadStartX-=size;
  if (roadStartZ >= size)   roadStartZ-=size;
  for (int x=0; x < 16; x++) {
    for (int z=0; z < 16; z++) {
      setBlock(result,x,0,z,bottom);
      biomes.setBiome(x,z,biome);
    }
  }
  if (plotMinZ + 1 <= 16 || roadStartZ <= 16 && roadStartZ > 0) {
    int start=(int)Math.max(16 - plotMinZ - pathsize + 1,16 - roadStartZ + 1);
    int end=(int)Math.min(16 - plotMinZ - 1,16 - roadStartZ + pathsize);
    if (start >= 0 && start <= 16 && end < 0)     end=16;
    setCuboidRegion(0,16,1,roadheight + 1,Math.max(start,0),Math.min(16,end),floor1);
  }
  if (plotMinX + 1 <= 16 || roadStartX <= 16 && roadStartX > 0) {
    int start=(int)Math.max(16 - plotMinX - pathsize + 1,16 - roadStartX + 1);
    int end=(int)Math.min(16 - plotMinX - 1,16 - roadStartX + pathsize);
    if (start >= 0 && start <= 16 && end < 0)     end=16;
    setCuboidRegion(Math.max(start,0),Math.min(16,end),1,roadheight + 1,0,16,floor1);
  }
  if (plotsize > 16) {
    if (roadStartX <= 16) {
      if (roadStartZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
      if (plotMinZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
    }
 else {
      if (roadStartZ <= 16) {
        if (plotMinX > 16) {
          setCuboidRegion(0,16,1,plotheight,0,16 - roadStartZ,getFilling(random));
          setCuboidRegion(0,16,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
        }
      }
    }
    if (plotMinX <= 16) {
      if (plotMinZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
 else {
        int z=(int)(16 - roadStartZ);
        if (z < 0)         z=16;
        setCuboidRegion(16 - plotMinX,16,1,plotheight,0,z,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,0,z,getPlotFloor(random));
      }
      if (roadStartZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
 else {
        if (roadStartX <= 16) {
          if (plotMinZ > 16) {
            int x=(int)(16 - roadStartX);
            if (x < 0)             x=16;
            setCuboidRegion(0,x,1,plotheight,0,16,getFilling(random));
            setCuboidRegion(0,x,plotheight,plotheight + 1,0,16,getPlotFloor(random));
          }
        }
      }
    }
 else {
      if (plotMinZ <= 16) {
        if (roadStartX > 16) {
          int x=(int)(16 - roadStartX);
          if (x < 0)           x=16;
          setCuboidRegion(0,x,1,plotheight,16 - plotMinZ,16,getFilling(random));
          setCuboidRegion(0,x,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
        }
      }
 else {
        if (roadStartZ > 16) {
          int x=(int)(16 - roadStartX);
          if (x < 0)           x=16;
          int z=(int)(16 - roadStartZ);
          if (z < 0)           z=16;
          if (roadStartX > 16) {
            setCuboidRegion(0,x,1,plotheight,0,z,getFilling(random));
            setCuboidRegion(0,x,plotheight,plotheight + 1,0,z,getPlotFloor(random));
          }
 else {
            setCuboidRegion(0,x,1,plotheight,0,z,getFilling(random));
            setCuboidRegion(0,x,plotheight,plotheight + 1,0,z,getPlotFloor(random));
          }
        }
      }
    }
  }
 else {
    if (roadStartX <= 16) {
      if (roadStartZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
      if (plotMinZ <= 16) {
        setCuboidRegion(0,16 - roadStartX,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(0,16 - roadStartX,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
    }
    if (plotMinX <= 16) {
      if (plotMinZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,16 - plotMinZ,16,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,16 - plotMinZ,16,getPlotFloor(random));
      }
      if (roadStartZ <= 16) {
        setCuboidRegion(16 - plotMinX,16,1,plotheight,0,16 - roadStartZ,getFilling(random));
        setCuboidRegion(16 - plotMinX,16,plotheight,plotheight + 1,0,16 - roadStartZ,getPlotFloor(random));
      }
    }
  }
  if (pathsize > 0) {
    if (plotMinZ + 1 <= 16) {
      double start, end;
      if (plotMinX + 2 <= 16)       start=16 - plotMinX - 1;
 else       start=16;
      if (roadStartX - 1 <= 16)       end=16 - roadStartX + 1;
 else       end=0;
      if (!(plotMinX + 2 <= 16 || roadStartX - 1 <= 16)) {
        start=0;
      }
      setCuboidRegion(0,end,1,wallheight + 1,16 - plotMinZ - 1,16 - plotMinZ,wallfilling);
      setCuboidRegion(0,end,wallheight + 1,wallheight + 2,16 - plotMinZ - 1,16 - plotMinZ,wall);
      setCuboidRegion(start,16,1,wallheight + 1,16 - plotMinZ - 1,16 - plotMinZ,wallfilling);
      setCuboidRegion(start,16,wallheight + 1,wallheight + 2,16 - plotMinZ - 1,16 - plotMinZ,wall);
    }
    if (plotMinX + 1 <= 16) {
      double start, end;
      if (plotMinZ + 2 <= 16)       start=16 - plotMinZ - 1;
 else       start=16;
      if (roadStartZ - 1 <= 16)       end=16 - roadStartZ + 1;
 else       end=0;
      if (!(plotMinZ + 2 <= 16 || roadStartZ - 1 <= 16)) {
        start=0;
      }
      setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,1,wallheight + 1,0,end,wallfilling);
      setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,wallheight + 1,wallheight + 2,0,end,wall);
      setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,1,wallheight + 1,start,16,wallfilling);
      setCuboidRegion(16 - plotMinX - 1,16 - plotMinX,wallheight + 1,wallheight + 2,start,16,wall);
    }
    if (roadStartZ <= 16 && roadStartZ > 0) {
      double start, end;
      if (plotMinX + 1 <= 16)       start=16 - plotMinX;
 else       start=16;
      if (roadStartX <= 16)       end=16 - roadStartX;
 else       end=0;
      if (!(plotMinX + 1 <= 16 || roadStartX <= 16)) {
        start=0;
      }
      setCuboidRegion(0,end,1,wallheight + 1,16 - roadStartZ,16 - roadStartZ + 1,wallfilling);
      setCuboidRegion(0,end,wallheight + 1,wallheight + 2,16 - roadStartZ,16 - roadStartZ + 1,wall);
      setCuboidRegion(start,16,1,wallheight + 1,16 - roadStartZ,16 - roadStartZ + 1,wallfilling);
      setCuboidRegion(start,16,wallheight + 1,wallheight + 2,16 - roadStartZ,16 - roadStartZ + 1,wall);
    }
    if (roadStartX <= 16 && roadStartX > 0) {
      double start, end;
      if (plotMinZ + 1 <= 16)       start=16 - plotMinZ;
 else       start=16;
      if (roadStartZ + 1 <= 16)       end=16 - roadStartZ + 1;
 else       end=0;
      if (!(plotMinZ + 1 <= 16 || roadStartZ + 1 <= 16)) {
        start=0;
      }
      setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,1,wallheight + 1,0,end,wallfilling);
      setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,wallheight + 1,roadheight + 2,0,end,wall);
      setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,1,wallheight + 1,start,16,wallfilling);
      setCuboidRegion(16 - roadStartX,16 - roadStartX + 1,wallheight + 1,wallheight + 2,start,16,wall);
    }
  }
  return result;
}