Overview
Regions Unexplored uses a multi-loader architecture powered by the Cloche build system, allowing the same codebase to target both Fabric and NeoForge mod loaders.This architecture minimizes code duplication by separating common logic from loader-specific implementations.
Source directory layout
Thesrc/ directory is organized into four main sections:
Common module
Thecommon/ directory contains platform-agnostic code that works across all mod loaders:
src/common/main/java/net/regions_unexplored/
src/common/main/java/net/regions_unexplored/
- Core
- Content
- World Generation
- Client
- Configuration
- Mixins
RegionsUnexplored.java- Main mod class and initializationregistry/- Registration of blocks, items, entities, featuresplatform/- Platform abstraction layer
src/common/main/resources/
src/common/main/resources/
assets/regions_unexplored/- Textures, models, soundsdata/regions_unexplored/- Recipes, loot tables, tags
src/common/main/regions_unexplored.mixins.json
src/common/main/regions_unexplored.mixins.json
Mixin configuration file defining:
- Required mixins for all platforms
- Compatibility level (Java 21)
- Refmap location
src/common/main/regions_unexplored.accesswidener
src/common/main/regions_unexplored.accesswidener
Access widener file to access private/protected Minecraft code
Fabric module
src/fabric/21.1/main/ contains Fabric-specific implementations:
RegionsUnexploredFabric.java
Fabric mod entrypoint and initialization
client/RegionsUnexploredFabricClient.java
Client-side Fabric initialization
compat/
Fabric-specific mod integrations (e.g., Mod Menu)
platform/
Fabric implementations of platform abstractions
Fabric mixins
Fabric mixins
Located in
src/fabric/21.1/main/regions_unexplored.fabric.mixins.jsonThese are Fabric-specific mixins that complement the common mixins.NeoForge module
src/neoforge/21.1/main/ contains NeoForge-specific implementations:
RegionsUnexploredNeo.java
NeoForge mod entrypoint and initialization
RegionsUnexploredNeoClient.java
Client-side NeoForge initialization
platform/
NeoForge implementations of platform abstractions
registry/
NeoForge-specific registry helpers
NeoForge mixins
NeoForge mixins
Located in
src/neoforge/21.1/main/regions_unexplored.neoforge.mixins.jsonThese are NeoForge-specific mixins.Shared version-specific code
src/shared/21.1/main/ contains code shared between loaders for Minecraft 1.21.1:
generated/
generated/
Auto-generated worldgen data from data generators:
data/regions_unexplored/worldgen/biome/- Biome definitionsdata/regions_unexplored/worldgen/placed_feature/- Placed featuresdata/regions_unexplored/worldgen/configured_feature/- Configured featuresdata/regions_unexplored/worldgen/processor_list/- Structure processors
Package organization
The main packagenet.regions_unexplored follows this structure:
Build configuration
The Cloche build system is configured inbuild.gradle.kts:
Key architectural patterns
Platform abstraction
Theplatform/ package provides an abstraction layer for loader-specific functionality:
Registry pattern
All game objects are registered through theregistry/ package, which handles loader differences:
Mixin usage
Mixins modify Minecraft’s code at runtime. The mod uses mixins for:- Custom crop placement logic
- Animal eating behavior modifications
- Tree generation enhancements
- Netherrack mechanics
Resource structure
Assets and data follow Minecraft’s standard structure:- Assets
- Data
Next steps
Building the mod
Learn how to build and package the mod
Getting started
Set up your development environment