Support .mctemplate and tar archives when importing a world#2290
Merged
Conversation
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.
Collaborator
|
Was there anything you needed help with getting this into a non-draft state? It seems like a great feature for creators |
Contributor
Author
I keep PRs as drafts until I have time to do proper testing, and also to get some feedback |
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
marked this pull request as ready for review
June 5, 2026 13:34
Contributor
Author
|
@FormallyMyles I've tested it and it works fine. Feel free to review |
FormallyMyles
requested changes
Jun 19, 2026
FormallyMyles
left a comment
Collaborator
There was a problem hiding this comment.
Minor comment but we'll get it through our QA after this is resolved
FormallyMyles
approved these changes
Jul 5, 2026
Collaborator
|
Thank you for this contribution 🥳 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).