Back to mods
TFC Registry API project artwork

CurseForge · Minecraft mod

TFC Registry API

Dynamically discovers and unifies access to all mod-added TFC registry types (metals, woods, ores, rocks, soils, sands, soil variants) from any mod using the registry interfaces.

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which TFC Registry API release should I use?

Updated 8 months ago
Latest stable file TFCRegistryAPI-1.21.x-1.2
Game version 1.21, 1.21.1
Loader NeoForge

TFC Registry API TFCRegistryAPI-1.21.x-1.2 targets 1.21, 1.21.1 with NeoForge. The project page does not say whether this file belongs on the client, dedicated server, or both. All 2 required mods have matching files.

Where it goes

Is TFC Registry API required on the client, server, or both?

The project page does not say whether this file belongs on the client, dedicated server, or both.

Client Source doesn’t say
Dedicated server Source doesn’t say
Loader for this release NeoForge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source does not explicitly classify this release as client-only or server-only.

What else does TFC Registry API TFCRegistryAPI-1.21.x-1.2 need?

TFCRegistryAPI-1.21.x-1.2. Change the file and its required mods may change too.

All 2 required mods have matching files

Install TerraFirmaCraft, Patchouli first. We found matching files for this game-version and loader setup. 2 come through another mod in the chain.

1 listed on this file 2 pulled in by those mods
TerraFirmaCraft Needed by TFC Registry API TFCRegistryAPI-1.21.x-1.2
required
Matching file found Matched file: TerraFirmaCraft 1.21.1-4.2.9
Just Enough Items (JEI) Needed by TerraFirmaCraft
pulled in
Matching file found Matched file: 19.50.0.414 for NeoForge 1.21.1
Patchouli Needed by TerraFirmaCraft
pulled in
Matching file found Matched file: Patchouli-1.21.1-93-NEOFORGE.jar

2 extra mods were pulled in by other dependencies. Indented rows show who needs each one. We only count dependency files that match this setup. A file for another loader does not fill the gap.

Before you install it

Add TFC Registry API without breaking your instance.

Built for TFC Registry API TFCRegistryAPI-1.21.x-1.2. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use TFCRegistryAPI-1.21.x-1.2. It targets 1.21, 1.21.1 with NeoForge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    Install TerraFirmaCraft, Patchouli first. We found matching files for this game-version and loader setup. 2 come through another mod in the chain.

  3. 03

    Put it on the correct side

    The project page does not say whether this file belongs on the client, dedicated server, or both.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside TFCRegistryAPI-1.21.x-1.2. It opens that exact file at the source.

About this project

What does TFC Registry API add?

TFC Registry API

A lightweight library mod that automatically discovers and unifies all TerraFirmaCraft registry types added by any mod. It works with any addon, as long as they correctly implement this library's registry interfaces or TFC's own:

  • RegistryMetal
  • RegistryRock
  • RegistrySoilVariant
  • RegistryWood

Where these are provided by this library:

  • RegistryOre
  • RegistrySand
  • RegistrySoil

How discovery works

The mod automatically finds all types if:

  • The type implements the correct Registry[Type] interface
  • The type is an enum (required for auto-discovery)

If an addon does not use enums or needs manual registration, it can still be supported by the addon developer by calling the helper registration methods directly:

Example: manually register soil variants from a non-enum source

SoilVariantRegistryHelper.registerTypes(
    YourSoilVariantClass.class,
    List.of(yourVariant1, yourVariant2, ...),
    "yourmodid"
);

Same method exists in every helper class:

MetalRegistryHelper.registerTypes(...)
WoodRegistryHelper.registerTypes(...)
RockRegistryHelper.registerTypes(...)
OreRegistryHelper.registerTypes(...)
SoilRegistryHelper.registerTypes(...)
SandRegistryHelper.registerTypes(...)
SoilVariantRegistryHelper.registerTypes(...)

Code examples:

// Metals
List<RegistryMetal> allMetals = MetalRegistryHelper.getAllMetalValues();
RegistryMetal brass = MetalRegistryHelper.getMetalValueOrDefault("brass");

// Woods
List<RegistryWood> allWoods = WoodRegistryHelper.getAllWoodValues();
RegistryWood ebony = WoodRegistryHelper.getWoodValueOrDefault("ebony");

// Rocks
List<RegistryRock> allRocks = RockRegistryHelper.getAllRockValues();
RegistryRock marble = RockRegistryHelper.getRockValueOrDefault("marble");

// Ores
List<RegistryOre> allOres = OreRegistryHelper.getAllOreValues();
RegistryOre sphalerite = OreRegistryHelper.getOreValueOrDefault("sphalerite");

// Soils
List<RegistrySoil> allSoils = SoilRegistryHelper.getAllSoilValues();
RegistrySoil duff = SoilRegistryHelper.getSoilValueOrDefault("duff");

// Sand colors
List<RegistrySand> allSands = SandRegistryHelper.getAllSandValues();
RegistrySand white = SandRegistryHelper.getSandValueOrDefault("white");

// Soil variants
List<RegistrySoilVariant> allVariants = SoilVariantRegistryHelper.getAllSoilVariantValues();
RegistrySoilVariant inceptisol = SoilVariantRegistryHelper.getSoilVariantValueOrDefault("inceptisol");

All get[Type]ValueOrDefault("name") methods are case-insensitive and return a safe fallback if not found.

For example, iterating over the List<RegistryWood> list, can yield a list of wood types like this, where this shows a scenario with ArborFirmaCraft installed:

acacia, ash, aspen, birch, blackwood, chestnut, douglas_fir, hickory, kapok, mangrove, maple, oak, palm, pine, rosewood, sequoia, spruce, sycamore, white_cedar, willow, araucaria, baobab, beech, cypress, eucalyptus, fig, ginkgo, hevea, ipe, ironwood, mahoe, mahogany, teak, tualang

You can easily register new blocks using the lists/getters provided by the helpers. Here is shown an example of how to add a new SoilBlock for all registered soil types and soil variants:

public static final Map<RegistrySoil, Map<RegistrySoilVariant, Id<Block>>> NEW_SOIL_BLOCKS =
    SoilRegistryHelper.getAllSoilValues().stream()
        .collect(Collectors.toMap(
            type -> type,
            type -> SoilVariantRegistryHelper.getAllSoilVariantValues().stream()
                .collect(Collectors.toMap(
                    variant -> variant,
                    variant -> register(type.toString() + "/" + variant.toString(),
                        () -> new SoilBlock(Block.Properties.of().mapColor(MapColor.DIRT).strength(1.4f), type, variant))
                ))
        ));

For example: if a block/item/entity/whatever constructor insists on using e.g. SoilBlockType, such as ConnectedGrassBlock, you can safely cast your soil from the RegistrySoil interface to it like this (RegistrySoil)(Object)soil (or however else you prefer to do it), since I've made TFC's SoilBlockTypeenum class implement the custom RegistrySoil interface.

Ideal for addons, modpack makers, or any setting that needs to work with every TFC-compatible metal, wood, rock, ore, soil, sand, or variant regardless of which mods are installed.

For example, you can use the registry type lists created by this library, to easily create new blocks, items, entities etc. for all of or the desired entries of the specific type.

Project description from CurseForge.

Pick your setup

TFC Registry API by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

11 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

TFC Registry API versions and loaders

3 of 3 releases match

Looking for an older file? The official CurseForge project page is in Resources.