Skip to content

yamporg/mods

Repository files navigation

CI workflow build status badge CD workflow release status badge

Mods

Monorepo for Minecraft mod projects.

Dynamic Darkness mod downloads counter badge
IFBHFix mod downloads counter badge
NopRecipeBook mod downloads counter badge

The Idea

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.

Getting Started

Prerequisites

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!

Building

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.

Running

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

Releasing

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

Known Issues

This section discusses known issues that may occur during development process.

runClient crashes with NPE at newChannel

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 MinecraftForge/ForgeGradle#750

Resources are missing in runClient

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 MinecraftForge/ForgeGradle#717 and https://redd.it/e4hfzz

503’s from CurseForge (or is it Cloudflare?)

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.