Back to mods
TLA Api project artwork

CurseForge · Minecraft mod

TLA Api

An abstraction layer over recipe viewer apis for minecraft.

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

Quick answer

Which TLA Api release should I use?

Updated 2 years ago
Latest stable file v1.2.1 [1.21]
Game version 1.21
Loader Fabric, Quilt

TLA Api v1.2.1 [1.21] targets 1.21 with Fabric, Quilt. The project page does not say whether this file belongs on the client, dedicated server, or both. All 1 required mods have matching files.

Where it goes

Is TLA 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 Fabric, Quilt
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 TLA Api v1.2.1 [1.21] need?

v1.2.1 [1.21]. Change the file and its required mods may change too.

All 1 required mods have matching files

Install Fabric API first. We found matching files for this game-version and loader setup.

Fabric API Needed by TLA Api v1.2.1 [1.21]
required
Matching file found Matched file: [1.21] Fabric API 0.102.0+1.21

We only count dependency files that match this setup. A file for another loader does not fill the gap.

Before you install it

Add TLA Api without breaking your instance.

Built for TLA Api v1.2.1 [1.21]. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use v1.2.1 [1.21]. It targets 1.21 with Fabric, Quilt; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    Install Fabric API first. We found matching files for this game-version and loader setup.

  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 v1.2.1 [1.21]. It opens that exact file at the source.

About this project

What does TLA Api add?

TLA Api

Badge showing the amount of downloads on modrinth Badge showing the amount of downloads on curseforge Badge linking to issues on github Badge linking to support on discord

TLA api is an abstraction layer over recipe viewer apis for minecraft. It allows mod developers to write their recipe viewer integration once and have it work with multiple recipe viewers. Currently supported recipe viewers are: EMI and REI

Usage

Gradle

TLA api is available on jitpack. Add the following to your build.gradle to use it:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    modImplementation "com.github.mattidragon:TlaApi:${tla_api_version}"
    include "com.github.mattidragon:TlaApi:${tla_api_version}"
}

Entrypoint

To use the api you need to implement the TlaApiPlugin interface and add your implementation to the tla-api entrypoint. Note that the entire api is client side only. If you are using split source sets, you need to implement the api in the client source set.

public class MyTlaPlugin implements TlaApiPlugin {
    @Override
    public void register(PluginContext context) {
        // Register your api here
    }
}
{
  "entrypoints": {
    "tla-api": [
      "my.package.MyTlaPlugin"
    ]
  }
}

Registering Content

Once you've set up your entrypoint you can begin registering content. The entire api is documented using javadocs, so you can use your IDE to explore the api. The api design is mostly based on EMIs, but I've had to make some changes to accommodate REI.

Things to Consider

While the TLA api abstracts everything, you will still need to verify yourself that your code works with both recipe viewers. For example, you still need to translate all of your tags for EMI. Some widgets might also render slightly differently.

A useful thing to look for while using the api are the following annotations. They help with explaining how the api should be used.

  • @ApiStatus.Internal: This means that the part of code is not meant to be used by mod developers.
  • @ImplementationOnly: This means that the part of code is only meant to be used by the implementation of the api for recipe viewers. Unless you are creating your own recipe viewer integration, you should not use these parts of the api.
  • @PluginOnly: This means that the part of code is only meant to be by plugins and not by the implementation of the api for recipe viewers.
  • @ImplementationsExtend: This indicates that the interface is implemented by the implementations of the api and plugins generally shouldn't implement it.
  • @PluginsExtend: This indicates that the interface is implemented by plugins and the implementations of the api generally shouldn't implement it.

Questions

Q: Does this allow mods that only support one viewer to work on both?

A: No. This api just makes it easier for mod developers to support both viewers.

Q: Why is this api client side only?

A: EMIs entire api is client side only. REI has a server side api, but it doesn't contain any features that TLA uses.

Q: Are there any examples?

A: Yes, you can find the test mod here. It does a few things you wouldn't normally do, but generally does a good job of showing off the api.

Project description from CurseForge.

Pick your setup

TLA Api by Minecraft version and loader

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

8 available setups

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

Recent files

TLA Api versions and loaders

6 of 6 releases match

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