Skip to main content

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

The src/ directory is organized into four main sections:
src/
├── common/           # Shared code for all loaders
├── fabric/           # Fabric-specific implementations
├── neoforge/         # NeoForge-specific implementations
└── shared/           # Version-specific shared code

Common module

The common/ directory contains platform-agnostic code that works across all mod loaders:
  • RegionsUnexplored.java - Main mod class and initialization
  • registry/ - Registration of blocks, items, entities, features
  • platform/ - Platform abstraction layer
  • assets/regions_unexplored/ - Textures, models, sounds
  • data/regions_unexplored/ - Recipes, loot tables, tags
Mixin configuration file defining:
  • Required mixins for all platforms
  • Compatibility level (Java 21)
  • Refmap location
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
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
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:
Auto-generated worldgen data from data generators:
  • data/regions_unexplored/worldgen/biome/ - Biome definitions
  • data/regions_unexplored/worldgen/placed_feature/ - Placed features
  • data/regions_unexplored/worldgen/configured_feature/ - Configured features
  • data/regions_unexplored/worldgen/processor_list/ - Structure processors
Do not manually edit these files - they are regenerated by data generators.

Package organization

The main package net.regions_unexplored follows this structure:
net.regions_unexplored/
├── RegionsUnexplored.java          # Main mod class
├── block/                          # Block implementations
│   ├── compat/                     # Cross-mod block compat
│   ├── sapling/                    # Sapling logic
│   └── set/                        # Block families
├── client/                         # Client-side code
│   ├── color/                      # Color providers
│   ├── particle/                   # Particles
│   ├── renderer/                   # Renderers
│   └── util/                       # Client utilities
├── config/                         # Configuration
├── entity/                         # Entities
│   ├── client/                     # Entity rendering
│   └── custom/                     # Custom entity types
├── internal/                       # Internal systems
│   └── config/                     # Config framework
├── item/                           # Items
│   ├── behaviour/                  # Item behaviors
│   └── items/                      # Item implementations
├── mixin/                          # Mixin patches
├── platform/                       # Platform abstraction
├── registry/                       # Registration
│   ├── data/                       # Data-driven content
│   └── tag/                        # Tag helpers
├── sound/                          # Sound events
├── util/                           # Utilities
└── world/                          # Worldgen
    ├── features/                   # Feature types
    │   ├── foliageplacers/        # Foliage placers
    │   └── treedecorators/        # Tree decorators
    └── level/block/               # World blocks
        ├── alpha/                 # Alpha biomes
        ├── cave/                  # Cave biomes
        ├── forest_dirt/           # Forest terrain
        ├── leaves/                # Leaf blocks
        ├── nether/                # Nether biomes
        ├── other/                 # Misc blocks
        ├── other_dirt/            # Misc terrain
        ├── plains_dirt/           # Plains terrain
        └── plant/                 # Plants

Build configuration

The Cloche build system is configured in build.gradle.kts:
1

Metadata block

Defines mod information:
metadata {
    modId = "regions_unexplored"
    name = "Regions Unexplored"
    description = "..."
    license = "All Rights Reserved"
    author("UHQ_Games")
    author("KirboSoftware")
    author("Apollo")
}
2

Common block

Configures shared code:
common {
    mixins.from(file("..."))
    accessWideners.from(file("..."))
    dependencies { ... }
}
3

Loader-specific blocks

Configures Fabric and NeoForge targets:
fabric("fabric:21.1") {
    minecraftVersion = "1.21.1"
    loaderVersion = "0.18.4"
    dependencies { fabricApi("0.116.8") }
}

neoforge("neoforge:21.1") {
    minecraftVersion = "1.21.1"
    loaderVersion = "21.1.218"
}

Key architectural patterns

Platform abstraction

The platform/ package provides an abstraction layer for loader-specific functionality:
// src/common/main/java/net/regions_unexplored/platform/
public interface Platform {
    boolean isModLoaded(String modId);
    Path getConfigDir();
    // ... other platform-specific methods
}

Registry pattern

All game objects are registered through the registry/ package, which handles loader differences:
public class RuBlocks {
    public static final DeferredRegister<Block> BLOCKS = ...;
    
    public static final RegistrySupplier<Block> EXAMPLE_BLOCK = 
        BLOCKS.register("example_block", () -> new Block(...));
}

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
Keep mixins minimal and focused. Prefer events or hooks when available.

Resource structure

Assets and data follow Minecraft’s standard structure:
assets/regions_unexplored/
├── blockstates/       # Block state definitions
├── lang/              # Translations
├── models/
│   ├── block/        # Block models
│   └── item/         # Item models
├── sounds/           # Sound files
├── sounds.json       # Sound definitions
└── textures/
    ├── block/        # Block textures
    ├── entity/       # Entity textures
    ├── item/         # Item textures
    └── particle/     # Particle textures

Next steps

Building the mod

Learn how to build and package the mod

Getting started

Set up your development environment

Build docs developers (and LLMs) love