TLA Api

Quick rating

Community listing page, reviews here may not be monitored by the author.

TLA Api

No reviews yet

An abstraction layer over recipe viewer apis for minecraft.

No Theme
No Genre
QoL & Tweaks
API/Library
Mod Loaders
Fabric
Quilt
Minecraft

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Where It Runs
Client Only

Runs entirely on the client. Works on vanilla servers.

About

Project Details

Type
Mod
License
MIT License
Latest Version
v1.2.1 [1.21]

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

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.

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.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~2,000
Total Downloads
CurseForge
<1,000
Modrinth
~2,000
Last Updated
CurseForge
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works