#optimization #minecraft #gamedev #jar #processing #resources #compression

mc-repack-core

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

13 releases (8 breaking)

0.27.1 Jul 29, 2024
0.26.0 Jun 25, 2024
0.18.1 Mar 6, 2024
0.18.0 Nov 4, 2023

#1622 in Game dev

Download history 210/week @ 2024-06-15 140/week @ 2024-06-22 10/week @ 2024-06-29 25/week @ 2024-07-06 121/week @ 2024-07-13 7/week @ 2024-07-20 244/week @ 2024-07-27 6/week @ 2024-08-03 1/week @ 2024-08-24 3/week @ 2024-08-31 38/week @ 2024-09-14 16/week @ 2024-09-21 7/week @ 2024-09-28

61 downloads per month
Used in mc-repack

MIT license

48KB
1K SLoC

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.

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–34MB
~458K SLoC