Program: 1275
Project: 1275
Buggy source:
private void generateBlockVertices(ChunkMesh mesh,int x,int y,int z){
  byte block=_chunk.getBlock(x,y,z);
  RENDER_TYPE renderType=RENDER_TYPE.TRANS;
  if (!Block.getBlockForType(block).isBlockTypeTranslucent()) {
    renderType=RENDER_TYPE.OPAQUE;
  }
  if (Block.getBlockForType(block).isBlockInvisible() || Block.getBlockForType(block).isBlockBillboard()) {
    return;
  }
  boolean drawFront, drawBack, drawLeft, drawRight, drawTop, drawBottom;
  byte blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y + 1),_chunk.getBlockWorldPosZ(z));
  drawTop=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z - 1));
  drawFront=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z + 1));
  drawBack=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x - 1),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z));
  drawLeft=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x + 1),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z));
  drawRight=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z));
  drawBottom=isSideVisibleForBlockTypes(blockToCheck,block);
  Block.BLOCK_FORM blockForm=Block.getBlockForType(block).getBlockForm();
  if (blockForm == Block.BLOCK_FORM.LOWERED_BOCK) {
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z - 1));
    drawFront=isSideVisibleForBlockTypes(blockToCheck,block) || drawFront;
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z + 1));
    drawBack=isSideVisibleForBlockTypes(blockToCheck,block) || drawBack;
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x - 1),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z));
    drawLeft=isSideVisibleForBlockTypes(blockToCheck,block) || drawLeft;
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x + 1),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z));
    drawRight=isSideVisibleForBlockTypes(blockToCheck,block) || drawRight;
  }
  if (drawTop) {
    Vector3f p1=VectorPool.getVector(-0.5f,0.5f,0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,0.5f,-0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(0,1,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.TOP);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.TOP).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.TOP).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawFront) {
    Vector3f p1=VectorPool.getVector(-0.5f,0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,0.5f,-0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,-0.5f,-0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,-0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(0,0,-1);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.FRONT);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.FRONT).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.FRONT).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawBack) {
    Vector3f p1=VectorPool.getVector(-0.5f,-0.5f,0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,-0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,0.5f,0.5f);
    Vector3f norm=VectorPool.getVector(0,0,1);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.BACK);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BACK).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BACK).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawLeft) {
    Vector3f p1=VectorPool.getVector(-0.5f,-0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(-0.5f,-0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(-0.5f,0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(-1,0,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.LEFT);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.LEFT).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.LEFT).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawRight) {
    Vector3f p1=VectorPool.getVector(0.5f,0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,-0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(0.5f,-0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(1,0,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.RIGHT);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.RIGHT).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.RIGHT).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawBottom) {
    Vector3f p1=VectorPool.getVector(-0.5f,-0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,-0.5f,-0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,-0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,-0.5f,0.5f);
    Vector3f norm=VectorPool.getVector(0,-1,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.BOTTOM);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BOTTOM).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BOTTOM).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
}

Fixed version (ground truth):
private void generateBlockVertices(ChunkMesh mesh,int x,int y,int z){
  byte block=_chunk.getBlock(x,y,z);
  RENDER_TYPE renderType=RENDER_TYPE.TRANS;
  if (!Block.getBlockForType(block).isBlockTypeTranslucent()) {
    renderType=RENDER_TYPE.OPAQUE;
  }
  if (Block.getBlockForType(block).isBlockInvisible() || Block.getBlockForType(block).isBlockBillboard()) {
    return;
  }
  boolean drawFront, drawBack, drawLeft, drawRight, drawTop, drawBottom;
  byte blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y + 1),_chunk.getBlockWorldPosZ(z));
  drawTop=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z - 1));
  drawFront=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z + 1));
  drawBack=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x - 1),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z));
  drawLeft=isSideVisibleForBlockTypes(blockToCheck,block);
  blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x + 1),_chunk.getBlockWorldPosY(y),_chunk.getBlockWorldPosZ(z));
  drawRight=isSideVisibleForBlockTypes(blockToCheck,block);
  if (y > 0) {
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z));
    drawBottom=isSideVisibleForBlockTypes(blockToCheck,block);
  }
 else {
    drawBottom=false;
  }
  Block.BLOCK_FORM blockForm=Block.getBlockForType(block).getBlockForm();
  if (blockForm == Block.BLOCK_FORM.LOWERED_BOCK) {
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z - 1));
    drawFront=isSideVisibleForBlockTypes(blockToCheck,block) || drawFront;
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z + 1));
    drawBack=isSideVisibleForBlockTypes(blockToCheck,block) || drawBack;
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x - 1),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z));
    drawLeft=isSideVisibleForBlockTypes(blockToCheck,block) || drawLeft;
    blockToCheck=_chunk.getParent().getBlock(_chunk.getBlockWorldPosX(x + 1),_chunk.getBlockWorldPosY(y - 1),_chunk.getBlockWorldPosZ(z));
    drawRight=isSideVisibleForBlockTypes(blockToCheck,block) || drawRight;
  }
  if (drawTop) {
    Vector3f p1=VectorPool.getVector(-0.5f,0.5f,0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,0.5f,-0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(0,1,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.TOP);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.TOP).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.TOP).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawFront) {
    Vector3f p1=VectorPool.getVector(-0.5f,0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,0.5f,-0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,-0.5f,-0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,-0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(0,0,-1);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.FRONT);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.FRONT).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.FRONT).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawBack) {
    Vector3f p1=VectorPool.getVector(-0.5f,-0.5f,0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,-0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,0.5f,0.5f);
    Vector3f norm=VectorPool.getVector(0,0,1);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.BACK);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BACK).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BACK).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawLeft) {
    Vector3f p1=VectorPool.getVector(-0.5f,-0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(-0.5f,-0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(-0.5f,0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(-1,0,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.LEFT);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.LEFT).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.LEFT).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawRight) {
    Vector3f p1=VectorPool.getVector(0.5f,0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,0.5f,0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,-0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(0.5f,-0.5f,-0.5f);
    Vector3f norm=VectorPool.getVector(1,0,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.RIGHT);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.RIGHT).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.RIGHT).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
  if (drawBottom) {
    Vector3f p1=VectorPool.getVector(-0.5f,-0.5f,-0.5f);
    Vector3f p2=VectorPool.getVector(0.5f,-0.5f,-0.5f);
    Vector3f p3=VectorPool.getVector(0.5f,-0.5f,0.5f);
    Vector3f p4=VectorPool.getVector(-0.5f,-0.5f,0.5f);
    Vector3f norm=VectorPool.getVector(0,-1,0);
    Vector4f colorOffset=Block.getBlockForType(block).getColorOffsetFor(Block.SIDE.BOTTOM);
    Vector3f texOffset=VectorPool.getVector(Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BOTTOM).x,Block.getBlockForType(block).getTextureOffsetFor(Block.SIDE.BOTTOM).y,0f);
    generateVerticesForBlockSide(mesh,x,y,z,p1,p2,p3,p4,norm,colorOffset,texOffset,renderType,blockForm);
    VectorPool.putVector(p1);
    VectorPool.putVector(p2);
    VectorPool.putVector(p3);
    VectorPool.putVector(p4);
    VectorPool.putVector(norm);
  }
}