TLA Api

⭐ — (3 endorsements) 📥 2,233 downloads 📌 v1.2.1+mc.1.21 📅 1/11/2024
🟠 Updated over a year ago

By MattiDragon · fabric

⬇ Download Mod Source: Modrinth ↗ 📅 Updated: 10/19/2024 📅 Created: 1/11/2024
⚠️ Install Order · 2 steps
1🛠️ Forge — Minecraft Forge (mod loader) Download ↗
2🛠️ Fabric — Fabric Loader Download ↗

Install in this order, then this mod last — most mods fail to load without their framework and dependencies in place.

🔍 Analysis

  • 👍 0.1% endorsement rate
  • 🏆 #767 of 945 fabric mods in this game by downloads

📋 About This Mod

# TLA Api (https://img.shields.io/badge/dynamic/json?color=2d2d2d&colorA=5da545&label=&suffix=%20downloads%20&query=downloads&url=https://api.modrinth.com/v2/project/gxkkdmTQ&style=flat-square&logo=modrinth&logoColor=2d2d2d)](https://modrinth.com/mod/tla-api) (https://img.shields.io/badge/dynamic/json?query=value&url=https://img.shields.io/curseforge/dt/959230.json&label=&logo=curseforge&color=2d2d2d&style=flat&labelColor=F16436&logoColor=2d2d2d&suffix=%20downloads)](https://www.curseforge.com/minecraft/mc-mods/tla-api) (https://img.shields.io/badge/dynamic/json?query=value&url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Fissues-raw%2Fmattidragon%2Ftlaapi.json&label=&logo=github&color=2d2d2d&style=flat-square&labelColor=6e5494&logoColor=2d2d2d&suffix=%20issues)](https://github.com/MattiDragon/TlaApi/issues) (https://img.shields.io/discord/760524772189798431?label=&logo=discord&color=2d2d2d&style=flat-square&labelColor=5865f2&logoColor=2d2d2d)](https://discord.gg/26T5KK2PBv) 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: (https://modrinth.com/mod/emi) and (https://modrinth.com/mod/rei) ## Usage ### Gradle TLA api is available on jitpack. Add the following to your build.gradle to use it: ```groovy 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. ```java public class MyTlaPlugin implements TlaApiPlugin { @Override public void register(PluginContext context) { // Register your api here } } ``` ```json { "entrypoints": { "tla-api": } } ``` ### 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 (https://github.com/mattidragon/TlaApi/tree/1.20.4/src/testmod). It does a few things you wouldn't normally do, but generally does a good job of showing off the api.

# TLA Api [!(https://img.shields.io/badge/dynamic/json?color=2d2d2d&colorA=5da545&label=&suffix=%20downloads%20&query=downloads&url=https://api.modrinth.com/v2/project/gxkkdmTQ&style=flat-square&logo=modrinth&logoColor=2d2d2d)](https://modrinth.com/mod/tla-api) [!(https://img.shields.io/badge/dynamic/json?query=value&url=https://img.shields.io/curseforge/dt/959230.json&label=&logo=curseforge&color=2d2d2d&style=flat&labelColor=F16436&logoColor=2d2d2d&suffix=%20downloads)](https://www.curseforge.com/minecraft/mc-mods/tla-api) [!(https://img.shields.io/badge/dynamic/json?query=value&url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Fissues-raw%2Fmattidragon%2Ftlaapi.json&label=&logo=github&color=2d2d2d&style=flat-square&labelColor=6e5494&logoColor=2d2d2d&suffix=%20issues)](https://github.com/MattiDragon/TlaApi/issues) [!(https://img.shields.io/discord/760524772189798431?label=&logo=discord&color=2d2d2d&style=flat-square&labelColor=5865f2&logoColor=2d2d2d)](https://discord.gg/26T5KK2PBv)

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: (https://modrinth.com/mod/emi) and (https://modrinth.com/mod/rei)

## Usage ### Gradle TLA api is available on jitpack. Add the following to your build.gradle to use it: ```groovy 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. ```java public class MyTlaPlugin implements TlaApiPlugin { @Override public void register(PluginContext context) { // Register your api here } } ``` ```json { "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 (https://github.com/mattidragon/TlaApi/tree/1. 20. 4/src/testmod). It does a few things you wouldn't normally do, but generally does a good job of showing off the api.

🤖 AI-enhanced — based on mod data

📊 Mod Details

Game
Minecraft Mods
Author
MattiDragon
Version
1.2.1+mc.1.21
Downloads
2,233
Endorsements
3
Category
fabric
Created
1/11/2024
Updated
10/19/2024
Game Versions
1.21
Tags
library

🔧 How to Install Minecraft Mods Mods

Download from Modrinth. Use Prism Launcher or drop into your mods folder.

📖 Full step-by-step install guide for Minecraft Mods →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Mods commands, item IDs, and more.

❓ Frequently Asked Questions

Which Minecraft Mods versions does TLA Api support?

The author lists 1.21. Other versions may work but are untested by the author.

What is the latest version of TLA Api?

Version 1.2.1+mc.1.21, published 2024-10-19 with 2,233 downloads recorded at the source.

Keep browsing — more Minecraft Mods mods await

📋 All Minecraft Mods Mods 🏆 Top 25 📂 More fabric 👤 More by MattiDragon 🔎 Similar Mods 🌐 Best fabric (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods