#optimization #minecraft #processing #jar #resources #repack

mc-repack-core

A library for repacking Minecraft mods and resource packs to optimize size and loading speed

4 releases

new 0.20.1 May 15, 2024
0.20.0 May 14, 2024
0.18.1 Mar 6, 2024
0.18.0 Nov 4, 2023

#1594 in Game dev

41 downloads per month
Used in mc-repack

MIT license

40KB
843 lines

The mc-repack-core create

This crate is a part of MC-Repack project, available on GitHub (see here).

Features

  • Minifying JSON files, using serde-json, and removing comments
  • Optimizing PNG files, using oxipng
  • Optimizing TOML files, using toml
  • Optimizing NBT files
  • Removing unwanted files – some project files (from Blender, Photoshop, etc.) are mistakenly packed in mods. This operation will detect and remove (ignore while repacking) these files.
  • Stripping Unicode BOM
  • Removing comment lines in many file types: .cfg, .obj, .mtl, .zs, .vsh, .fsh
  • Recompressing files more efficiently
  • Now with Zopfli support (slower, but better compression)

For more info, visit the MC-Repack webpage


lib.rs:

MC-Repack is initially built as a CLI app, but can also be used as a library. This crate contains methods necessary to work with files that need optimizations.

You should be interested in optimizer module. There are important methods used for repaching and optimizing files.

This crate considers that the repacked files are used in Minecraft mods. You can still use the library for other types, like Android or Gradle files.

Dependencies

~3–32MB
~431K SLoC