|
| 1 | +This mod uses the preprocessor [Discombobulator](https://github.com/MinecraftTAS/Discombobulator), |
| 2 | +which allows us to have one codebase for multiple Minecraft versions. |
| 3 | + |
| 4 | +### 1. Clone this repository into your workspace |
| 5 | +```sh |
| 6 | +git clone https://github.com/MinecraftTAS/LoTAS-Light.git |
| 7 | +``` |
| 8 | +### 2. Go into the project |
| 9 | +```sh |
| 10 | +cd LoTAS-Light/ |
| 11 | +``` |
| 12 | +### 3. Setup sub projects |
| 13 | +Run |
| 14 | +```sh |
| 15 | +./gradlew preprocessBase |
| 16 | +``` |
| 17 | +This will copy the files from `LoTAS-Light/src/...` into `LoTAS-Light/1.20.4/src`, `LoTAS-Light/1.20.6/src`, etc... |
| 18 | + |
| 19 | +And code between comments like |
| 20 | +```java |
| 21 | +// # 1.20.6 |
| 22 | +//$$ LoTASLight.savestateHandler |
| 23 | +// # 1.20.4 |
| 24 | + LoTASLight.savestateHandler=null; |
| 25 | +// # end |
| 26 | +``` |
| 27 | +will be enabled or disabled accordingly between each version |
| 28 | +### 4. Import root project into your IDE |
| 29 | +#### IntelliJ |
| 30 | +You only need to open the build.gradle file in LoTAS-Light (not in sub projects like 1.20.4, those will be automatically imported!) and it should recognize it as a gradle project |
| 31 | +#### Eclipse |
| 32 | +1. Set your workspace folder to the parent folder of the LoTAS-Light folder, so if you have something like `workspace/LoTAS-Light`, set the workspace folder to "workspace". |
| 33 | +2. Click `File>Import` then search for "Existing Gradle project" and click next |
| 34 | +3. Select the "LoTAS-Light" folder as a project root directory then click next |
| 35 | +4. (optional) In this step you can set up a specific JDK and gradle version if you haven't set that up yet, but currently this project needs JDK 23 and a Gradle version greater than 8.12.1. |
| 36 | +5. Then click finish and wait for it to set up |
| 37 | + |
| 38 | +### 5. Decompile source and download assets |
| 39 | +You have to run the gradle task `genSources`. You can do that from within your IDE or run `./gradlew genSources` in the console. This will decompile all Minecraft versions |
| 40 | + |
| 41 | +#### Eclipse |
| 42 | +Additionally you need to run the task `eclipse` as well, which will generate .launch configs in each subproject which you can use to start Minecraft from withing your IDE |
| 43 | + |
| 44 | +## Building |
| 45 | +After you have set up and preprocessed the versions, you can run either `./gradlew :1.21.4:build` to build only one version (built jar can be found in `LoTAS-Light/1.21.4/build/libs`), or run the task `collectBuilds`. This will build all versions and collect all versions in `LoTAS-Light/build` |
| 46 | + |
| 47 | +For more information on how to work with Discombobulator, check the [Wiki](https://github.com/MinecraftTAS/Discombobulator/wiki) or ask us on [Discord](https://discord.gg/jGhNxpd) |
0 commit comments