Monorepo for Minecraft mod projects.
Common build script tweaks are Gradle plugins in buildSrc. Each individual project decides which tweaks to apply as well as which third-party plugins versions to use. Plugins in buildSrc must not depend on any third-party plugin, but may provide optional integration (e.g. reproducible-builds plugin fixes non-determinism in ForgeGradle tasks).
Currently, this project contains only Forge mods, but it should be possible to have Fabric mods alongside.
It’s recommended to use the latest IntelliJ IDEA release with Minecraft Dev for IntelliJ plugin. Gradle distribution specified in gradle-wrapper.properties will be automatically downloaded on project import. Note that you don’t have to install a specific JDK version, Gradle handles that for you!
To start with the project, you can either import it with IntelliJ IDEA or simply build from the command line.
gradle build
That would output jar archives to <project-name>/build/libs
directory.
Each subproject defines either runClient or runServer tasks, or both, if it makes sense. To generate run/debug configurations, execute genIntellijRuns task. You may need to reopen the project and/or change SDK version in the generated configuration afterwards.
gradle genIntellijRuns
Alternatively, just run the Gradle task without generating IDE configuration.
gradle :darkness-forge-1.12.x:runClient
The CI runs upload task on tag push. The tag must follow the <project>/v<semver>
format where <project>
is the name of the project (e.g. darkness-forge-1.12.x
) and <semver>
is the semantic version.
For example, to publish release v0.4.0-beta of darkness-forge-1.12.x, run the following:
git tag darkness-forge-1.12.x/v0.4.0-beta
git push --tags
This section discusses known issues that may occur during development process.
There seems to be an issue with interactions between ForgeGradle and Minecraft 1.12.x where the required libraries are missing when runClient task is called outside of IDE with clean cache. The workaround is to bootstrap the cache using an IDE.
See https://github.com/MinecraftForge/ForgeGradle/issues/750
For some reason resources are not loaded with Minecraft 1.12.x in runClient task unless we put them to classes directory directly. Newer version of Minecraft work just fine though. We used to have a workaround based on build.gradle from Chiseled Me mod, but removed it to avoid maintenance burden.
See https://github.com/MinecraftForge/ForgeGradle/issues/717 and https://redd.it/e4hfzz
If you are getting HTTP 503’s errors for CurseForge API, set up a proxy. E.g. something like the command below is good enough for local testing.
CURSEFORGE_TOKEN=xxx gradle :darkness-forge-1.12.x:curseforge -D'org.gradle.jvmargs=-DsocksProxyHost=45.79.207.110 -DsocksProxyPort=9200'
Also, I have no freaking idea why is that happening. I’ve tried connecting from two distinct local ISPs and that didn’t help.