This is a command line interface tool used by MineSuperior to optimize the file-size and compression of a Minecraft (Java Edition) resource pack.
Minecraft resource packs are often space inefficient and poorly compressed.
This tool aims to solve that problem by optimizing file sizes and compression of the archive.
This tool works by performing the following steps:
-
Copy all files from the input directory into a temporary directory.
-
Remove unnecessary files from the temporary directory.
- Remove
*.old
,*.md
files.
- Remove
-
Compress / minify files in the temporary directory.
-
Minify json-like
*.json
,*.mcmeta
files. -
Minify yaml-like
*.yaml
,*.yml
files. -
Minify open gl shader library
*.fsh
,*.vsh
files. -
Compress png-like
*.png
files.
-
-
Optionally, create a zip archive of the temporary directory.
-
Output the processed files (or zip archive) to the output directory.
-
Cleanup of the temporary directory.
-
Rust.
-
Cargo (included with Rust).
-
A basic understanding of the command line / terminal.
-
Clone this repository.
-
Run
cargo build --release
in the root directory of this project. -
The compiled binary will be located at
./target/release/ms-rpo
.
-
Rename the compiled binary to
ms-rpo
(consistent with examples). -
Add the compiled binary to your
PATH
. -
Reload your shell / terminal to apply the changes.
-
First, read the warnings in the caution section below.
-
Run
ms-rpo --help
to see the available options. -
Run
ms-rpo
with the desired options.
Note: This only works if you added the compiled binary to your PATH
.
ms-rpo -i "./test/input" -o "./test/output" -z "optimized-resource-pack.zip" --no-confirm
Flag | Value | Description |
---|---|---|
-h --help |
Show the help message. | |
-i --input |
A path to a folder | The input directory. |
-o --output |
A path to a folder | The output directory. |
-z --zip |
If provided, a file name with extension | Optionally, output as a zip file with the provided name. |
--no-confirm |
Skip confirmation prompts. |
-
⚠️ The--no-confirm
flag will not prompt for confirmation before performing destructive operations. -
⚠️ By default, the output directory is deleted every time the program is run.
This project is licensed under the MIT License.