cinematic subtitles

A subtitle API that can generate subtitles for videos
Back to Files

cinematic_subtitles-0.2.6.jar

File namecinematic_subtitles-0.2.6.jar
Uploaded
Nov 16, 2026
Downloads
2
Size
289.3 KB
Mod Loaders
Forge
File ID
9647034
Type
R
Release
Supported game versions
  • 1.20.1

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:cinematic-subtitles-1786568:9647034")

Learn more about Curse Maven

What's new

# 0.2.7 Update

 

## English

### Added

- **Multiple formats can coexist for one subtitle.** A single logical subtitle id may ship `.srt`, `.sfst`, `.lrc` and `.json` (key-value) files at the same time, plus one **code-embedded** table; playback picks one according to the preferred format. Added the pure-Java `SubtitleLibrary` (variant registry, layered preferences, fallback) and the `SubtitleFormat` enum (aliases such as `subrip` / `kv` / `code`, fixed fallback order `srt → sfst → lrc → json → inline`).
- **Per-group `root.json`.** Drop a `root.json` into `config/cinematic_subtitles/subtitles/<group>/` to set that group's preferred format with `default_format` (**defaults to srt**), override individual subtitles with `preferred`, and optionally set a default subtitle style with `type`. Legacy flat files in `subtitles/` still work (a root-level `root.json` acts as the default group).
- **Addon-specified defaults.** `SubtitleAPI.setDefaultSubtitleFormat("lrc")` sets a global default; `registerEmbeddedSubtitle(id, table)` / `registerEmbeddedSubtitle(id, format, content)` embed subtitles directly in code, coexisting with file variants under the same id and surviving `/subtitles reload`.
- **Player-editable per-subtitle preference.** `/subtitles prefer <id> <format>` writes to `config/cinematic_subtitles/subtitle_preferences.json` (also hand-editable); the `PLAYER` layer has the highest priority.
- **Resource-pack overrides.** Ship `assets/cinematic_subtitles/subtitle_formats.json` in any resource pack to override the preferred format of every registered subtitle via `preferred` (per id), `groups` (whole group) or `default_format` (global). It is re-read on every playback, so **F3+T resource reload takes effect immediately**.
- **Priority rules:** explicit per-subtitle preferences `PLAYER > RESOURCE_PACK > GROUP_ROOT`; default formats `PLAYER > RESOURCE_PACK > GROUP_ROOT (group root.json) > API_GLOBAL (addon code) > built-in srt`. An explicit preference always beats any default. If the preferred format has no variant for that id, the library falls back to the first available one in `srt → sfst → lrc → json → inline` order.
- **`{lang:key}` vanilla localization.** Any source (`.sfst` / `.srt` / `.lrc` / `.json`, commands, API, credits) can write `{lang:cinematic_subtitles.demo.greeting}` and it is expanded through the vanilla language file (`I18n`) before rendering. Expansion happens before newline decoding and inline color parsing, so translated text may still contain `{#hex}`, `{mc:}`, bare `§`, `{img:}` and `\n`, and the resulting glyphs take part in the typewriter animation normally. Aliases `{lang=…}`, `{translate:…}`, `{i18n:…}`, `{tr:…}` work; `{{` escaping is respected; results are not recursively expanded (self-reference safe). SRT exports expand the tags too.
- **Native localization format in JSON, no `{lang:}` tag required.** An entry may replace `text` with `lang` (or `lang_key` / `translatable`), use `{"text":{"lang":"key"}}`, or `"text":"key" + "translatable":true`. Array elements can be plain localization-key strings, and a whole table can be `{"lang":["key1","key2",…]}` (3 seconds per line). Legacy `key` / `translation` / `i18n` fields stay compatible.
- **Optional trailing `[end timestamp]` in LRC.** Append one `[MM:SS.xx]` at the end of a line to get SRT / SFST-style ranges, e.g. `[00:01.00]Lyrics[00:04.50]` = 1.00s–4.50s. Without it, classic LRC behaviour is unchanged (lasts until the next line, +3 s for the final one), byte-for-byte compatible with existing files. Multiple leading timestamps plus a trailing end stamp are supported (same line shown at several times, one shared end), and an end earlier than the start is clamped.
- **Commands:** `/subtitles play <id>` without an extension plays a registered subtitle id (automatic format selection); with an extension it still loads that exact file (legacy behaviour). Added `/subtitles formats` listing registered subtitles, coexisting formats, current preference and its source; `/subtitles reload` now rebuilds the library too.
- Added samples: the `demo_pack/` group (4 formats of the same `intro` + `root.json`), `demo_lang.sfst` / `demo_lang.json` / `demo_lang_keys.json` (localization reference), `demo_lrc_range.lrc` (end timestamps), player-preference and resource-pack-override examples, and bilingual demo language keys.</id></format></id></group>

This mod has no additional files