|
| 1 | +# BTW-gradle-fabric-example |
| 2 | + |
| 3 | +This repository is based on the [BTW-Gradle](https://github.com/BTW-Community/BTW-gradle) and the [Example Mod](https://github.com/minecraft-cursed-legacy/Example-Mod) |
| 4 | +repositories, combining them to enable fabric development for the Better Than Wolves mod. |
| 5 | +**This repository was only tested for client-side development yet.** |
| 6 | + |
| 7 | +## Quick Start |
| 8 | + |
| 9 | +* Clone this repository |
| 10 | +* Acquire the full BTW sources and put them under `src/btw/java` |
| 11 | +* (Optional) Put the BTW resources (textures, etc.) under `src/btw/resources` |
| 12 | +* Run the gradle task *btwJar* |
| 13 | +* Run the gradle task *build* and then *runClient* |
| 14 | +* (Optional) Put the vanilla MC resources (sounds) under `run/resources` |
| 15 | + |
| 16 | +## BTW Source Code |
| 17 | + |
| 18 | +To get access to the Better Than Wolves source code, please refer to the [BTW-Gradle repository](https://github.com/BTW-Community/BTW-gradle) |
| 19 | + or (alternatively) the [BTW-Public repository](https://github.com/BTW-Community/BTW-Public), which also offers a way to generate the sources. |
| 20 | + |
| 21 | +## Development |
| 22 | + |
| 23 | +Similar to the [BTW-Gradle](https://github.com/BTW-Community/BTW-gradle) project, this repository comes with a few configuration files for IntelliJ IDEA. |
| 24 | + |
| 25 | +In this repository, there is an example implementation of a fabric mod that is a BTW-Addon at the same time. Base class overwrites, |
| 26 | +either for initializing your BTW-Addon or for changes to the functionality of MC are in many cases not needed |
| 27 | +anymore. (But they are still possible, put the overwriting-sources under `main/java/net/minecraft/src`. |
| 28 | + This requires your mod to be loaded as a coremod, which is currently not supported in a dev-environment - only in production.) The |
| 29 | +addon initialization is taken care of by the PreLaunchInitializer. |
| 30 | + |
| 31 | +For functionality changes to base classes, please have a look at mixins, which enable you |
| 32 | +to inject code at runtime, offering much better compatibility. Most fabric-mixin tutorials should apply here, but keep in |
| 33 | +mind that no fabric-api is available yet, just bare mixins. An even more powerful alternative is fabric-asm, but this has not |
| 34 | +been tested yet. |
| 35 | + |
| 36 | +If you use reflection, please keep in mind that it is now, in many cases at least, not needed anymore, in addition to the fact that fabric |
| 37 | +remaps Minecraft at runtime into an intermediary form, which is different from the obfuscated one. To get the intermediary names |
| 38 | +of classes, fields, and methods, have a look at the mappings under `custom_mappings`. |
| 39 | + |
| 40 | +## Releasing Mods/Addons |
| 41 | + |
| 42 | +If you want to run fabric mods with BTW in a non-dev environment, you have to either use |
| 43 | +the [BTW-fabric MultiMC instance](https://github.com/BTW-Community/cursed-fabric-loader/releases/latest) (recommended) or |
| 44 | +follow the [installation instructions for the Vanilla launcher](https://github.com/BTW-Community/legacy-fabric-installer/releases/latest). |
| 45 | + |
| 46 | + |
| 47 | +Drop on by the discord server if you need help: [BTW Discord](https://discord.gg/fhMK5kx). |
| 48 | + |
| 49 | +The mod file for the release is generated by the Gradle task *remapJar* and then put into `release`. |
| 50 | + |
| 51 | +After successfully importing the MultiMC instance, you can put your mod file into the mods folder of your installation. |
| 52 | +If it is a coremod, put it into coremods. |
| 53 | + |
| 54 | +## Issues & Troubleshooting |
| 55 | + |
| 56 | +* How do I obtain the BTW-sources? *Please refer to [BTW-Gradle](https://github.com/BTW-Community/BTW-gradle) or [BTW-Public](https://github.com/BTW-Community/BTW-Public).* |
| 57 | + |
| 58 | +More troubleshooting is still todo. Feel free to message me on Discord. |
| 59 | + |
| 60 | +## MultiMC Remarks |
| 61 | +* The MultiMC instance should support most BTW versions and their addons, install them normally via `Add to Minecraft.jar`. |
| 62 | +* Addons developed outside of the fabric environment that use |
| 63 | +Java reflection might not work if they reference obfuscated names via Strings (as mentioned above). |
| 64 | +Porting those addons is a simple process though, as only the new intermediary names have to be adopted. |
| 65 | + |
| 66 | +## License |
| 67 | +This project incorporates: |
| 68 | +* A modified version of [Fabric Loom](https://github.com/FabricMC/fabric-loom) (MIT) |
| 69 | +* A precompiled version of [Tiny Remapper](https://github.com/FabricMC/tiny-remapper) (LGPL-3.0) |
0 commit comments