KLAXXL
Mung modpacks for maximum minification! Tested against a modified version of MeatballCraft (12.2 pack), but should theoretically work for almost any modpack on any version. I've probably overlooked some things though.
How it works
Given a folder, it steps through every file in the folder and mungs it, using one of the methods in mungFile as
appropriate for the file's extension.
- ZIP and JAR files are recursively unzipped, so the files inside can be recompressed. They are also coerced to STORE
compression, to allow whatever outer compressor you use on the whole pack (
zstd --ultra -22is recommended) the best scenario. - Pictures get (almost) losslessly compressed with oxipng and ECT
- Audio files are crushed to
-qscale:a 1with ffmpeg, then run through optivorbis - Class files are scanned for fingerprint checks, which get deleted with ASM. These would otherwise block the pack from running, as many files get altered, changing their fingerprints.
- Key files are deleted and signatures are removed from
MANIFEST.MFfiles, for the same reason.
This approach should work on any modpacks... with a few caveats. Mods that do their own fingerprinting instead of relying on Forge's would have to be manually patched or skipped. Modpacks containing any non-free assets likely cannot be distributed publically post-munging, as modifying and conveying said non-free asset is probably illegal.
Dependencies
A *nix-ish OS probably (only tested on Linux, others probably work tho) and
- ect
- ffmpeg, ffprobe
- optivorbis
- oxipng
TODO:
- Add other things
Licensing
KLAXXL is copyrighted by ah-OOG-ah, 2024, and distributed under the LGPLv3 or any later version. License headers must be applied to new files and updated to existing ones as per the template. The LGPLv3 by itself is in LICENSE, but the GPLv3 and LGPLv3 are also in COPYING and COPYING.LESSER as per FSF convention.
Some third-party code was used in this project. See 3RD-PARTY-LICENSES for details.
All four of these files should be kept in sync with the ones in src/main/resources. I would just symlink them, but that may cause issues for people checking out the repository on different platforms.