Skip to content

Support .mctemplate and tar archives when importing a world#2290

Merged
FormallyMyles merged 8 commits into
HiveGamesOSS:developfrom
Fabrimat:archive-support
Jul 5, 2026
Merged

Support .mctemplate and tar archives when importing a world#2290
FormallyMyles merged 8 commits into
HiveGamesOSS:developfrom
Fabrimat:archive-support

Conversation

@Fabrimat

Copy link
Copy Markdown
Contributor

The world selection now detects archives by their magic bytes, so .mctemplate files (which are zips internally) are handled by the existing zip path. Tar archives are extracted via tar-stream, with support for gzip (.tar.gz/.tgz) and brotli (.tar.br) compression as well as uncompressed tarballs (tar is used by Pterodactyl Panel).

clankstar and others added 3 commits April 1, 2026 14:56
The world selection now detects archives by their magic bytes, so
.mctemplate files (which are zips internally) are handled by the
existing zip path. Tar archives are extracted via tar-stream, with
support for gzip (.tar.gz/.tgz) and brotli (.tar.br) compression as
well as uncompressed tarballs.
@Fabrimat
Fabrimat changed the base branch from main to develop May 27, 2026 15:40
@FormallyMyles

Copy link
Copy Markdown
Collaborator

Was there anything you needed help with getting this into a non-draft state? It seems like a great feature for creators

@Fabrimat

Fabrimat commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Was there anything you needed help with getting this into a non-draft state? It seems like a great feature for creators

I keep PRs as drafts until I have time to do proper testing, and also to get some feedback

Fabrimat added 3 commits June 5, 2026 14:55
The longer 'Select archive' description wraps onto an extra line, which made that button taller than 'Choose world folder'. Wrap both buttons in a flex row that stretches them to an equal height and centre their content so they stay the same size.
Move the zip extraction out of Session into a reusable extractZip helper in util.js, mirroring extractTar, so both archive paths can be unit tested. Add node:test coverage which builds zip, tar, tar.gz and tar.br worlds in memory and checks they're detected and extracted below the level.dat. The electron package now exposes an npm test script which runs as part of the Gradle build.
@Fabrimat
Fabrimat marked this pull request as ready for review June 5, 2026 13:34
@Fabrimat
Fabrimat requested a review from a team as a code owner June 5, 2026 13:34
@Fabrimat

Copy link
Copy Markdown
Contributor Author

@FormallyMyles I've tested it and it works fine. Feel free to review

@FormallyMyles FormallyMyles left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment but we'll get it through our QA after this is resolved

Comment thread app/electron/src/session.js Outdated
@Fabrimat
Fabrimat requested a review from FormallyMyles June 29, 2026 08:49
@FormallyMyles
FormallyMyles merged commit 81b9796 into HiveGamesOSS:develop Jul 5, 2026
2 checks passed
@FormallyMyles

Copy link
Copy Markdown
Collaborator

Thank you for this contribution 🥳

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.

3 participants