A powerful Gradle plugin for decompiling, patching, and recompiling Minecraft source code, written with legacy Minecraft in mind.
- JDK 17 or higher
- Gradle 8.0+ (Gradle Wrapper included)
- Kotlin 2.0.20+
Add the plugin to your project's build script:
// build.gradle.kts
plugins {
id("dev.lunasa.patcher") version "1.0-SNAPSHOT"
}Configure the patcher in your build script:
patcher {
minecraftVersion = "1.8.9"
}To do anything on a Patcher project locally, it is crucial you set up the environment first by running the following command:
./gradlew setupEnvAfter this, you can use the following commands to manage your patches and run the Minecraft client.
./gradlew applyPatches- Apply patches to the source code./gradlew generatePatches- Generate patches from source modifications./gradlew generateDeltas- Generate the binary patches and bundle it with the project../gradlew runClient- Launch the modified Minecraft client
When you run generateDeltas, it will build the project for you and bundle a patches.zip file. This file contains the binary patches that can be used to apply changes to the Minecraft JARs. It is intended that these patches be distributed with your JAR.
The patches.zip file contains the XDelta binary patches between your modified source code and the original source code. This allows you to distribute only the changes instead of the entire modified source code.
See the example test-project for how to apply these patches during runtime.
Generally, you will want to discover & load all patches from the patches.zip in your JAR root, and either redefine the classes using a Java Agent or transform the classes at load time. It is up to you how you want to apply these patches, but the Patcher plugin provides a convenient way to generate, maintain and bundle them.
Contributions are always welcome! Feel free to submit issues or pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GNU GPL 3.0 License - see the LICENSE.md file for details.
- Vineflower for decompilation
- Tiny-Remapper for bytecode remapping
- Legacy Fabric for mappings
- All contributors and users of this tool