Skip to content

A wicked project aims at compressing most of the code & resource in a Fabric Mod efficiently.

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
LGPL-3.0
LICENSE-LGPL
Unlicense
LICENSE-UNLICENSE
Notifications You must be signed in to change notification settings

LucunJi/Compression-Is-All-You-Need

banner

Compression Is All You Need

Test Build

A wicked project aims at compressing most of the code & resource in a Fabric Mod efficiently.

Using the forked small project ExtraPlayerRenderer as an example, the size is reduced from 79.2KiB to 59.3KiB, that's around 25% cut-down (excluding the jar-in-jars and licenses).

For larger projects with much, much, much more code and resource, the reduction in size is expected to be much larger.

The project title and banner serve as a harmless mockery.

Builds

Find in Releases, or latest builds in GitHub Actions (may expire).

Or build on your own: ./gradlew build

The output is located at build/libs/xxx-darkmagic-xxx.jar

How it works?

Most of the code and resource are compressed into tar.gz. Only bootstrap code and necessary data remain intact.

At preLaunch entrypoint, the compressed code and resources are extracted, then Classloader, mod information, mixins will be updated.

See code in src/main/java/github/io/lucunji/explayerenderer/bootstrap for how it loads, and tasks in build.gradle for how the Jar is built.

Note: Apache Commons Compress that I used to extract .tar archives is only available on client side. To make this work on server side, modify the build script and java code to replace .tar with an uncompressed, storage .zip. jar-in-jar is needed, which may cause an additional 1MiB space usage.

License

I don't expect someone will use this weird code in some day, but well, who knows?

The code related to building and launching special jars are released under Unlicense, all other code (forked from ExtraPlayerRenderer) remains in LGPL-3.0-or-later (LGPL 3.0+).

See the LICENSE, LICENSE-LGPL, LICENSE-UNLICENSE files at project root for detailed explanation.

About

A wicked project aims at compressing most of the code & resource in a Fabric Mod efficiently.

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
LGPL-3.0
LICENSE-LGPL
Unlicense
LICENSE-UNLICENSE

Stars

Watchers

Forks

Packages

No packages published

Languages