Program: 96674
Project: 96674
Buggy source:
/** 
 * Send a single chunk to the client
 * @param chunkX The chunk X coordinate
 * @param chunkZ The chunk Z coordinate
 */
private synchronized void sendChunk(int chunkX,int chunkZ){
  try {
    if (!this.getSession().getPlayer().getWorld().getChunkAt(chunkX,chunkZ).isLoaded()) {
      this.getSession().getPlayer().getWorld().loadChunk(chunkX,chunkZ,true);
    }
    GlowChunkSnapshot chunk=this.getSession().getPlayer().getWorld().getChunkAt(chunkX,chunkZ).getChunkSnapshot();
    ByteArrayOutputStream totalData=new ByteArrayOutputStream();
    PEBinaryWriter writer=new PEBinaryWriter(totalData);
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y++) {
          if (chunk.getBlockTypeId(x,y,z) != 0) {
            writer.writeByte((byte)0x00);
          }
 else {
            writer.writeByte((byte)0x00);
          }
        }
      }
    }
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y+=2) {
          byte data;
          data=(byte)((chunk.getBlockData(x,y,z) & 0xF) << 4);
          data|=chunk.getBlockData(x,y + 1,z) & 0xF;
          writer.writeByte(data);
        }
      }
    }
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y+=2) {
          byte data;
          data=(byte)((chunk.getBlockSkyLight(x,y,z) & 0xF) << 4);
          data|=chunk.getBlockSkyLight(x,y + 1,z) & 0xF;
          writer.writeByte(data);
        }
      }
    }
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y+=2) {
          byte data;
          data=(byte)((chunk.getBlockEmittedLight(x,y,z) & 0xF) << 4);
          data|=chunk.getBlockEmittedLight(x,y + 1,z) & 0xF;
          writer.writeByte(data);
        }
      }
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0xFF);
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0x01);
      writer.writeByte((byte)0x85);
      writer.writeByte((byte)0xB2);
      writer.writeByte((byte)0x4A);
    }
{
      ByteArrayOutputStream bos=new ByteArrayOutputStream();
      NBTOutputStream n=new NBTOutputStream(bos);
      n.writeTag(new CompoundTag());
      writer.switchEndianness();
      writer.writeInt(bos.toByteArray().length);
      writer.write(bos.toByteArray());
      writer.switchEndianness();
    }
    FullChunkPacket packet=new FullChunkPacket();
    packet.chunkX=chunkX;
    packet.chunkZ=chunkZ;
    packet.chunkData=totalData.toByteArray();
    this.getSession().send(packet);
    System.out.println("String_Node_Str" + chunkX + "String_Node_Str"+ chunkZ);
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Send a single chunk to the client
 * @param chunkX The chunk X coordinate
 * @param chunkZ The chunk Z coordinate
 */
private synchronized void sendChunk(int chunkX,int chunkZ){
  try {
    if (!this.getSession().getPlayer().getWorld().getChunkAt(chunkX,chunkZ).isLoaded()) {
      this.getSession().getPlayer().getWorld().loadChunk(chunkX,chunkZ,true);
    }
    GlowChunkSnapshot chunk=this.getSession().getPlayer().getWorld().getChunkAt(chunkX,chunkZ).getChunkSnapshot();
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y++) {
          if (chunk.getBlockTypeId(x,y,z) != 0) {
            writer.writeByte((byte)(this.getSession().getTranslator().getItemTranslator().translateToPE(chunk.getBlockTypeId(x,y,z)) & 0xFF));
          }
 else {
            writer.writeByte((byte)0x00);
          }
        }
      }
    }
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y+=2) {
          byte data;
          data=(byte)((chunk.getBlockData(x,y,z) & 0xF) << 4);
          data|=chunk.getBlockData(x,y + 1,z) & 0xF;
          writer.writeByte(data);
        }
      }
    }
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y+=2) {
          byte data;
          data=(byte)((chunk.getBlockSkyLight(x,y,z) & 0xF) << 4);
          data|=chunk.getBlockSkyLight(x,y + 1,z) & 0xF;
          writer.writeByte(data);
        }
      }
    }
    for (int x=0; x < 16; x++) {
      for (int z=0; z < 16; z++) {
        for (int y=0; y < 128; y+=2) {
          byte data;
          data=(byte)((chunk.getBlockEmittedLight(x,y,z) & 0xF) << 4);
          data|=chunk.getBlockEmittedLight(x,y + 1,z) & 0xF;
          writer.writeByte(data);
        }
      }
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0xFF);
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0x01);
      writer.writeByte((byte)0x85);
      writer.writeByte((byte)0xB2);
      writer.writeByte((byte)0x4A);
    }
    writer.switchEndianness();
    writer.writeInt(0);
    writer.switchEndianness();
    FullChunkPacket packet=new FullChunkPacket();
    packet.chunkX=chunkX;
    packet.chunkZ=chunkZ;
    packet.chunkData=totalData.toByteArray();
    this.getSession().send(packet);
    totalData.reset();
    System.out.println("String_Node_Str" + chunkX + "String_Node_Str"+ chunkZ);
  }
 catch (  IOException e) {
  }
}