Skip to main content

Quick build

To build all mod variants (Fabric and NeoForge):
./gradlew build
Built JAR files will be located in:
  • build/libs/fabric-21.1/ - Fabric build
  • build/libs/neoforge-21.1/ - NeoForge build
The version number is set in build.gradle.kts as version = "0.6+indev"

Building specific loaders

You can build for a specific mod loader to save time:
Build only the Fabric version:
./gradlew :fabric:21.1:build
Output: build/libs/fabric-21.1/regions_unexplored-fabric-21.1-0.6+indev.jar

Build tasks

Remove all build artifacts:
./gradlew clean
Use this when you want a fresh build or are experiencing caching issues.
Compile code, run tests, and create JAR files:
./gradlew build
This is the standard build command that produces distributable JARs.
Create JARs without running tests:
./gradlew assemble
Faster than build when you don’t need to run tests.
Build JAR files for all targets:
./gradlew jar
Equivalent to assemble for this project.
Generate worldgen data files:
./gradlew :fabric:21.1:runData
Generated files are placed in src/shared/21.1/main/generated/

Build output structure

After running ./gradlew build, your build directory will contain:
build/
├── libs/
│   ├── fabric-21.1/
│   │   └── regions_unexplored-fabric-21.1-0.6+indev.jar
│   └── neoforge-21.1/
│       └── regions_unexplored-neoforge-21.1-0.6+indev.jar
├── classes/               # Compiled Java classes
├── resources/             # Processed resources
└── tmp/                   # Temporary build files
Only the JAR files in build/libs/ are needed for distribution.

Clean builds

For a completely clean build (recommended before releases):
1

Clean all build artifacts

./gradlew clean
2

Build everything

./gradlew build
3

Verify outputs

Check that both JAR files were created:
ls -lh build/libs/*/regions_unexplored-*.jar

JAR file contents

Each built JAR contains:
  • Compiled Java classes from common/ and loader-specific modules
  • Mixin configurations
  • Access widener definitions

Version management

The mod version is defined in build.gradle.kts:
group = "net.regions_unexplored"
version = "0.6+indev"
1

Update version number

Edit the version field in build.gradle.kts:
version = "1.0.0"
2

Clean and rebuild

./gradlew clean build
3

Verify JAR names

JAR files will reflect the new version:
  • regions_unexplored-fabric-21.1-1.0.0.jar
  • regions_unexplored-neoforge-21.1-1.0.0.jar
Follow semantic versioning (MAJOR.MINOR.PATCH) for release versions.

Testing builds

Before distributing, test your builds:
Test in the development environment first:
./gradlew :fabric:21.1:runClient

Build optimization

Parallel builds

The project is configured for parallel builds in gradle.properties:
org.gradle.parallel=true
This allows Gradle to build multiple modules simultaneously.

Build cache

Enable Gradle’s build cache for faster rebuilds:
./gradlew build --build-cache
Or enable it globally in ~/.gradle/gradle.properties:
org.gradle.caching=true

Daemon

The Gradle daemon keeps Gradle running in the background for faster builds. It’s enabled by default. To stop the daemon:
./gradlew --stop

Troubleshooting

Increase the Gradle JVM memory in gradle.properties:
org.gradle.jvmargs=-Xmx6G
The default is 4GB, but complex builds may need more.
Ensure you’re using the correct task path:
# Correct
./gradlew :fabric:21.1:build

# Incorrect
./gradlew fabric:build
The version number (21.1) is required in the task path.
Verify resources are in the correct locations:
  • Assets: src/common/main/resources/assets/
  • Data: src/common/main/resources/data/
  • Generated: src/shared/21.1/main/generated/
Run ./gradlew clean build for a fresh build.
If ./gradlew doesn’t work, ensure the wrapper is executable:
chmod +x gradlew
On Windows, use gradlew.bat instead.
Clear Gradle’s cache and retry:
rm -rf ~/.gradle/caches
./gradlew build --refresh-dependencies

Publishing

When ready to publish your build:
1

Update version

Set a release version in build.gradle.kts (remove +indev):
version = "1.0.0"
2

Clean build

./gradlew clean build
3

Test thoroughly

Test both Fabric and NeoForge builds in production environments
4

Upload to platforms

Upload the JAR files to:Ensure you upload the correct JAR for each platform (Fabric vs NeoForge)
Always test builds thoroughly before publishing. Check for compatibility with the required Biolith and Lithostitched versions.

Next steps

Getting started

Learn how to set up your development environment

Project structure

Understand the codebase organization

Build docs developers (and LLMs) love