Program: 80058
Project: 80058
Buggy source:
@Override public void addEdgeGeometry(final int x,final int y,final int z,BlockContext world,BlockTypeRegistry registry,RawChunk rawChunk,Geometry geometry){
  final int data=rawChunk.getBlockData(x,y,z);
  final boolean isHead=(data & 0x8) > 0;
  final float texel=1.0f / 64.0f;
  String xyz="String_Node_Str" + String.valueOf(x) + "String_Node_Str"+ String.valueOf(y)+ "String_Node_Str"+ String.valueOf(z);
  String color=Colors.byId(rawChunk.getBeds().get(xyz).getColor()).getName();
  SubTexture texture=world.getTexturePack().findTexture(null,"String_Node_Str" + color);
  SubTexture headTop=new SubTexture(texture.texture,texture.u0 + texel * 6,texture.v0 + texel * 6,texture.u0 + texel * 22,texture.v0 + texel * 21.8f);
  SubTexture footTop=new SubTexture(texture.texture,texture.u0 + texel * 6,texture.v0 + texel * 28.2f,texture.u0 + texel * 22,texture.v0 + texel * 43.9f);
  SubTexture headSide=new SubTexture(texture.texture,texture.u0,texture.v0 + texel * 6.1f,texture.u0 + texel * 6,texture.v0 + texel * 21.9f);
  SubTexture footSide=new SubTexture(texture.texture,texture.u0,texture.v0 + texel * 28.1f,texture.u0 + texel * 6,texture.v0 + texel * 43.9f);
  SubTexture headEdge=new SubTexture(texture.texture,texture.u0 + texel * 6.1f,texture.v0,texture.u0 + texel * 21.9f,texture.v0 + texel * 6);
  SubTexture footEdge=new SubTexture(texture.texture,texture.u0 + texel * 22.1f,texture.v0 + texel * 22,texture.u0 + texel * 37.9f,texture.v0 + texel * 27.9f);
  SubTexture leg=new SubTexture(texture.texture,texture.u0 + texel * 50,texture.v0 + texel * 3.1f,texture.u0 + texel * 53,texture.v0 + texel * 6);
  final float lightness=Chunk.getLight(world.getLightStyle(),LightFace.Top,rawChunk,x,y,z);
  Vector4f white=new Vector4f(lightness,lightness,lightness,1);
  final float height=1.0f / 16.0f * 9.0f;
  final float legHeight=1.0f / 16.0f * 3.0f;
  SubMesh bedMesh=new SubMesh();
  SubTexture topTex=isHead ? headTop : footTop;
  bedMesh.addQuad(new Vector3f(0,height,0),new Vector3f(1,height,0),new Vector3f(1,height,1),new Vector3f(0,height,1),white,topTex);
  if (isHead) {
    bedMesh.addQuad(new Vector3f(0,legHeight,0),new Vector3f(1,legHeight,0),new Vector3f(1,height,0),new Vector3f(0,height,0),white,headEdge);
    bedMesh.addQuad(new Vector3f(1,height,0),new Vector3f(1,legHeight,0),new Vector3f(1,legHeight,1),new Vector3f(1,height,1),white,new Vector2f(headSide.u1,headSide.v0),new Vector2f(headSide.u0,headSide.v0),new Vector2f(headSide.u0,headSide.v1),new Vector2f(headSide.u1,headSide.v1));
    bedMesh.addQuad(new Vector3f(0,legHeight,0),new Vector3f(0,height,0),new Vector3f(0,height,1),new Vector3f(0,legHeight,1),white,headSide);
    SubMesh.addBlockSimple(bedMesh,0,0,0,legHeight,legHeight,legHeight,white,leg,leg,leg);
    SubMesh.addBlockSimple(bedMesh,1 - legHeight,0,0,legHeight,legHeight,legHeight,white,leg,leg,leg);
  }
 else {
    bedMesh.addQuad(new Vector3f(1,legHeight,1),new Vector3f(0,legHeight,1),new Vector3f(0,height,1),new Vector3f(1,height,1),white,footEdge);
    bedMesh.addQuad(new Vector3f(1,height,0),new Vector3f(1,legHeight,0),new Vector3f(1,legHeight,1),new Vector3f(1,height,1),white,new Vector2f(footSide.u1,footSide.v0),new Vector2f(footSide.u0,footSide.v0),new Vector2f(footSide.u0,footSide.v1),new Vector2f(footSide.u1,footSide.v1));
    bedMesh.addQuad(new Vector3f(0,legHeight,0),new Vector3f(0,height,0),new Vector3f(0,height,1),new Vector3f(0,legHeight,1),white,footSide);
    SubMesh.addBlockSimple(bedMesh,0,0,1 - legHeight,legHeight,legHeight,legHeight,white,leg,leg,leg);
    SubMesh.addBlockSimple(bedMesh,1 - legHeight,0,1 - legHeight,legHeight,legHeight,legHeight,white,leg,leg,leg);
  }
  SubMesh.Rotation rotation=Rotation.None;
  float angle=0;
  final int dir=(data & 0x3);
  if (dir == 0) {
    rotation=Rotation.AntiClockwise;
    angle=180;
  }
 else   if (dir == 1) {
    rotation=Rotation.Clockwise;
    angle=90;
  }
 else   if (dir == 2) {
  }
 else   if (dir == 3) {
    rotation=Rotation.AntiClockwise;
    angle=90;
  }
 else {
    System.err.println("String_Node_Str");
  }
  bedMesh.pushTo(geometry.getMesh(texture.texture,Geometry.MeshType.AlphaTest),x,y,z,rotation,angle);
}

Fixed version (ground truth):
@Override public void addEdgeGeometry(final int x,final int y,final int z,BlockContext world,BlockTypeRegistry registry,RawChunk rawChunk,Geometry geometry){
  final int data=rawChunk.getBlockData(x,y,z);
  final boolean isHead=(data & 0x8) > 0;
  final float texel=1.0f / 64.0f;
  String xyz="String_Node_Str" + String.valueOf(x) + "String_Node_Str"+ String.valueOf(y)+ "String_Node_Str"+ String.valueOf(z);
  BedEntity be=rawChunk.getBeds().get(xyz);
  String color="String_Node_Str";
  if (be != null)   color=Colors.byId(be.getColor()).getName();
  SubTexture texture=world.getTexturePack().findTexture(null,"String_Node_Str" + color);
  SubTexture headTop=new SubTexture(texture.texture,texture.u0 + texel * 6,texture.v0 + texel * 6,texture.u0 + texel * 22,texture.v0 + texel * 21.8f);
  SubTexture footTop=new SubTexture(texture.texture,texture.u0 + texel * 6,texture.v0 + texel * 28.2f,texture.u0 + texel * 22,texture.v0 + texel * 43.9f);
  SubTexture headSide=new SubTexture(texture.texture,texture.u0,texture.v0 + texel * 6.1f,texture.u0 + texel * 6,texture.v0 + texel * 21.9f);
  SubTexture footSide=new SubTexture(texture.texture,texture.u0,texture.v0 + texel * 28.1f,texture.u0 + texel * 6,texture.v0 + texel * 43.9f);
  SubTexture headEdge=new SubTexture(texture.texture,texture.u0 + texel * 6.1f,texture.v0,texture.u0 + texel * 21.9f,texture.v0 + texel * 6);
  SubTexture footEdge=new SubTexture(texture.texture,texture.u0 + texel * 22.1f,texture.v0 + texel * 22,texture.u0 + texel * 37.9f,texture.v0 + texel * 27.9f);
  SubTexture leg=new SubTexture(texture.texture,texture.u0 + texel * 50,texture.v0 + texel * 3.1f,texture.u0 + texel * 53,texture.v0 + texel * 6);
  final float lightness=Chunk.getLight(world.getLightStyle(),LightFace.Top,rawChunk,x,y,z);
  Vector4f white=new Vector4f(lightness,lightness,lightness,1);
  final float height=1.0f / 16.0f * 9.0f;
  final float legHeight=1.0f / 16.0f * 3.0f;
  SubMesh bedMesh=new SubMesh();
  SubTexture topTex=isHead ? headTop : footTop;
  bedMesh.addQuad(new Vector3f(0,height,0),new Vector3f(1,height,0),new Vector3f(1,height,1),new Vector3f(0,height,1),white,topTex);
  if (isHead) {
    bedMesh.addQuad(new Vector3f(0,legHeight,0),new Vector3f(1,legHeight,0),new Vector3f(1,height,0),new Vector3f(0,height,0),white,headEdge);
    bedMesh.addQuad(new Vector3f(1,height,0),new Vector3f(1,legHeight,0),new Vector3f(1,legHeight,1),new Vector3f(1,height,1),white,new Vector2f(headSide.u1,headSide.v0),new Vector2f(headSide.u0,headSide.v0),new Vector2f(headSide.u0,headSide.v1),new Vector2f(headSide.u1,headSide.v1));
    bedMesh.addQuad(new Vector3f(0,legHeight,0),new Vector3f(0,height,0),new Vector3f(0,height,1),new Vector3f(0,legHeight,1),white,headSide);
    SubMesh.addBlockSimple(bedMesh,0,0,0,legHeight,legHeight,legHeight,white,leg,leg,leg);
    SubMesh.addBlockSimple(bedMesh,1 - legHeight,0,0,legHeight,legHeight,legHeight,white,leg,leg,leg);
  }
 else {
    bedMesh.addQuad(new Vector3f(1,legHeight,1),new Vector3f(0,legHeight,1),new Vector3f(0,height,1),new Vector3f(1,height,1),white,footEdge);
    bedMesh.addQuad(new Vector3f(1,height,0),new Vector3f(1,legHeight,0),new Vector3f(1,legHeight,1),new Vector3f(1,height,1),white,new Vector2f(footSide.u1,footSide.v0),new Vector2f(footSide.u0,footSide.v0),new Vector2f(footSide.u0,footSide.v1),new Vector2f(footSide.u1,footSide.v1));
    bedMesh.addQuad(new Vector3f(0,legHeight,0),new Vector3f(0,height,0),new Vector3f(0,height,1),new Vector3f(0,legHeight,1),white,footSide);
    SubMesh.addBlockSimple(bedMesh,0,0,1 - legHeight,legHeight,legHeight,legHeight,white,leg,leg,leg);
    SubMesh.addBlockSimple(bedMesh,1 - legHeight,0,1 - legHeight,legHeight,legHeight,legHeight,white,leg,leg,leg);
  }
  SubMesh.Rotation rotation=Rotation.None;
  float angle=0;
  final int dir=(data & 0x3);
  if (dir == 0) {
    rotation=Rotation.AntiClockwise;
    angle=180;
  }
 else   if (dir == 1) {
    rotation=Rotation.Clockwise;
    angle=90;
  }
 else   if (dir == 2) {
  }
 else   if (dir == 3) {
    rotation=Rotation.AntiClockwise;
    angle=90;
  }
 else {
    System.err.println("String_Node_Str");
  }
  bedMesh.pushTo(geometry.getMesh(texture.texture,Geometry.MeshType.AlphaTest),x,y,z,rotation,angle);
}