Skip to content

feat(modpack): add self-contained full pack export/import for offline play - #46

Merged
Origin173 merged 4 commits into
mainfrom
feat/modpack-export
Aug 16, 2026
Merged

feat(modpack): add self-contained full pack export/import for offline play#46
Origin173 merged 4 commits into
mainfrom
feat/modpack-export

Conversation

@Origin173

@Origin173 Origin173 commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a new Full Pack (Offline) export format that bundles the version-isolated instance content plus the game libraries (libraries/) and assets (assets/) into a single zip, identified by an xmcl-full-pack.json manifest.
  • Import is a pure extraction — nothing is downloaded — so the instance can be launched offline immediately after import.
  • Adds two backend commands (scan_instance_files_for_full_export, import_full_pack), a Full format in the export modal, and full-pack-aware import handling (name is fixed by the pack, no download tasks, direct navigation to the instance list).
  • Fills the missing exportModpack / scanInstanceFilesForExport / FileTreeSelector.empty service-message translations in fr/ja/zh-Hant so the locale consistency check passes.

Pack layout

<zip>/
├── xmcl-full-pack.json   # { formatVersion:1, name, version, minecraftVersion, modLoader, ... }
├── instance/<name>/      # version-isolated instance content (user selection + mandatory core files)
├── libraries/            # game dir shared libraries
└── assets/               # game dir shared assets (indexes + objects)

Notes

  • Already-compressed files (jar/zip/images/audio) are stored as-is; other files are deflated.
  • Import validates every entry against path escape (zip-slip protection) and rewrites the instance id to the target game directory.
  • Known pre-existing (unchanged): MultiMC packs are still reported with modpackType = "modrinth" in modpack meta info — out of scope for this PR.

Test plan

  • cargo check
  • npx tsc --noEmit
  • npm run locale diff en
  • Export an instance as Full Pack and inspect the zip layout + manifest
  • Import the pack into a fresh game directory and launch offline

Origin173 added 4 commits June 6, 2026 00:06
… play

Export an instance as a Full Pack: version-isolated instance content plus
game libraries/assets bundled in one zip with an xmcl-full-pack.json manifest.
Import is pure extraction with zero downloads, so the instance launches offline.
Adds scan_instance_files_for_full_export / import_full_pack commands, a Full
export format in the export modal, and full-pack-aware import handling.
Also ignores the .zcode/ plan directory and fills missing service message
translations in fr/ja/zh-Hant.
After importing a full pack the instance list was read from the cached
GlobalDataContext state, so the imported instance only appeared after a
manual refresh or restart. Force a refresh via getInstanceList(true),
matching the pattern used by other instance mutations (delete, edit dir).
@Origin173
Origin173 merged commit d74ec74 into main Aug 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant