Program: 96726
Project: 96726
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);
    if (writer.getEndianness() == PEBinaryUtils.BIG_ENDIAN) {
      writer.switchEndianness();
    }
    writer.writeInt(chunkX);
    writer.writeInt(chunkZ);
    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);
          }
        }
      }
    }
    writer.write(new byte[16384]);
    for (int i=0; i < 16384; i++) {
      writer.writeByte((byte)0xF0);
    }
    for (int i=0; i < 16384; i++) {
      writer.writeByte((byte)0x11);
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0x00);
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0x00);
      writer.writeByte((byte)0x85);
      writer.writeByte((byte)0xB2);
      writer.writeByte((byte)0x4A);
    }
    Deflater deflater=new Deflater(2);
    deflater.reset();
    deflater.setInput(totalData.toByteArray());
    deflater.finish();
    byte[] bufferDeflate=new byte[65536];
    int deflatedSize=deflater.deflate(bufferDeflate);
    FullChunkPacket packet=new FullChunkPacket();
    packet.compressedData=ArrayUtils.subarray(bufferDeflate,0,deflatedSize);
    this.getSession().send(packet);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

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();
    ByteArrayOutputStream totalData=new ByteArrayOutputStream();
    PEBinaryWriter writer=new PEBinaryWriter(totalData);
    if (writer.getEndianness() == PEBinaryUtils.BIG_ENDIAN) {
      writer.switchEndianness();
    }
    writer.writeInt(chunkX);
    writer.writeInt(chunkZ);
    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);
          }
        }
      }
    }
    writer.write(new byte[16384]);
    for (int i=0; i < 16384; i++) {
      writer.writeByte((byte)0xF0);
    }
    for (int i=0; i < 16384; i++) {
      writer.writeByte((byte)0x11);
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0x00);
    }
    for (int i=0; i < 256; i++) {
      writer.writeByte((byte)0x00);
      writer.writeByte((byte)0x85);
      writer.writeByte((byte)0xB2);
      writer.writeByte((byte)0x4A);
    }
    Deflater deflater=new Deflater(2);
    deflater.reset();
    deflater.setInput(totalData.toByteArray());
    deflater.finish();
    byte[] bufferDeflate=new byte[65536];
    int deflatedSize=deflater.deflate(bufferDeflate);
    FullChunkPacket packet=new FullChunkPacket();
    packet.compressedData=ArrayUtils.subarray(bufferDeflate,0,deflatedSize);
    this.getSession().send(packet);
  }
 catch (  IOException e) {
  }
}