Program: 166088
Project: 166088
Buggy source:
public void toBytes(ByteBuf buf){
  ByteBufTools.writeEnum(buf,terrainType,TerrainType.TERRAIN_VOID);
  ByteBufTools.writeEnumCollection(buf,featureTypes);
  ByteBufTools.writeEnumCollection(buf,structureTypes);
  ByteBufTools.writeEnumCollection(buf,effectTypes);
  buf.writeInt(biomes.size());
  for (  BiomeGenBase entry : biomes) {
    buf.writeInt(entry.biomeID);
  }
  ByteBufTools.writeString(buf,digitString);
  buf.writeInt(Block.blockRegistry.getIDForObject(baseBlockForTerrain));
  buf.writeInt(Block.blockRegistry.getIDForObject(tendrilBlock));
  buf.writeInt(Block.blockRegistry.getIDForObject(sphereBlock));
  buf.writeInt(Block.blockRegistry.getIDForObject(canyonBlock));
  buf.writeInt(Block.blockRegistry.getIDForObject(fluidForTerrain));
  buf.writeInt(extraOregen.length);
  for (  Block block : extraOregen) {
    buf.writeInt(Block.blockRegistry.getIDForObject(block));
  }
  buf.writeInt(fluidsForLakes.length);
  for (  Block block : fluidsForLakes) {
    buf.writeInt(Block.blockRegistry.getIDForObject(block));
  }
  buf.writeBoolean(peaceful);
  ByteBufTools.writeFloat(buf,celestialAngle);
  ByteBufTools.writeFloat(buf,timeSpeed);
  buf.writeInt(probeCounter);
  buf.writeInt(actualRfCost);
  skyDescriptor.toBytes(buf);
  buf.writeInt(extraMobs.size());
  for (  MobDescriptor mob : extraMobs) {
    ByteBufTools.writeString(buf,mob.getEntityClass().getName());
    buf.writeInt(mob.getSpawnChance());
    buf.writeInt(mob.getMinGroup());
    buf.writeInt(mob.getMaxGroup());
    buf.writeInt(mob.getMaxLoaded());
  }
}

Fixed version (ground truth):
public void toBytes(ByteBuf buf){
  ByteBufTools.writeEnum(buf,terrainType,TerrainType.TERRAIN_VOID);
  ByteBufTools.writeEnumCollection(buf,featureTypes);
  ByteBufTools.writeEnumCollection(buf,structureTypes);
  ByteBufTools.writeEnumCollection(buf,effectTypes);
  buf.writeInt(biomes.size());
  for (  BiomeGenBase entry : biomes) {
    buf.writeInt(entry.biomeID);
  }
  ByteBufTools.writeString(buf,digitString);
  buf.writeInt(Block.blockRegistry.getIDForObject(baseBlockForTerrain));
  buf.writeInt(Block.blockRegistry.getIDForObject(tendrilBlock));
  buf.writeInt(Block.blockRegistry.getIDForObject(sphereBlock));
  buf.writeInt(Block.blockRegistry.getIDForObject(canyonBlock));
  buf.writeInt(Block.blockRegistry.getIDForObject(fluidForTerrain));
  buf.writeInt(extraOregen.length);
  for (  Block block : extraOregen) {
    buf.writeInt(Block.blockRegistry.getIDForObject(block));
  }
  buf.writeInt(fluidsForLakes.length);
  for (  Block block : fluidsForLakes) {
    buf.writeInt(Block.blockRegistry.getIDForObject(block));
  }
  buf.writeBoolean(peaceful);
  ByteBufTools.writeFloat(buf,celestialAngle);
  ByteBufTools.writeFloat(buf,timeSpeed);
  buf.writeInt(probeCounter);
  buf.writeInt(actualRfCost);
  skyDescriptor.toBytes(buf);
  buf.writeInt(extraMobs.size());
  for (  MobDescriptor mob : extraMobs) {
    if (mob != null) {
      if (mob.getEntityClass() != null) {
        ByteBufTools.writeString(buf,mob.getEntityClass().getName());
        buf.writeInt(mob.getSpawnChance());
        buf.writeInt(mob.getMinGroup());
        buf.writeInt(mob.getMaxGroup());
        buf.writeInt(mob.getMaxLoaded());
      }
    }
  }
}