Armor Render Lib

Armor Render Lib

Small extension library to Fabric API's ArmorRenderer, with more targeted and specific implementation to dynamically change armor texture and color.

by
2.6K Downloads
fabricequipmentlibrary
Rent Server with this Mod

About this Mod

Armor Render Lib

Armor Render Lib is a lightweight extension library to Fabric API's fabric-rendering-v1 ArmorRenderer. Since the Fabric API implementation is quite abstract, a more targeted implementation is needed for some specific use cases. These use cases are present across more than one of my mods, so in the spirit of code reuse this library was created. It is robust, using only a few very targeted mixins and is fully compatible with Cosmetic Armor and GeckoLib.

Build

To include this library in your project, copy the following into your build.gradle:

repositories {
    maven {
        name = "Modrinth"
        url = "https://api.modrinth.com/maven"
        content {
            includeGroup "maven.modrinth"
        }
    }
}
dependencies {
    modImplementation "maven.modrinth:armor-render-lib:<version>"
    include "maven.modrinth:armor-render-lib:<version>"
}

Use

Armor Render Lib adds armor render layers. These are objects containing a dynamic texture location, color and glint boolean that render armor for an item (or items). They are roughly equivalent to Fabric API's ArmorRenderer#renderPart, but the texture, color and glint can be dynamically specified based on the ItemStack, LivingEntity and EquipmentSlot.

They should be registered like so:

public class ExampleMod implements ClientModInitializer {
    private static ArmorRenderProvider render(ItemStack stack, LivingEntity entity, EquipmentSlot slot) {
        // Dynamic texture path
        String texture = "examplemod:textures/model/armor/example_chestplate.png";
        
        // Dynamic color
        int color = 0xFF00FF;
        
        return data -> data.accept(texture, color, stack.hasGlint());
    }
    
    @Override
    public void onInitializeClient() {
        ArmorRenderLib.register(ExampleMod::render, Items.IRON_CHESTPLATE);
    }
}

Notes

  • An item can have multiple different armor render layers registered to it.
  • Multiple items can have the same armor render layer registered to them.
  • Registering a render layer to a vanilla item (or other armor item) overrides the default armor rendering.
    • This means that the texture, color and/or enchantment glint of vanilla armor can be modified.

Available Versions

0.2.6beta
MC 1.19.2fabric
August 30, 2022
0.2.5beta
MC 1.19fabric
August 30, 2022
0.1.3beta
MC 1.18.2fabric
August 30, 2022
0.2.4beta
MC 1.19.2fabric
August 17, 2022
0.2.3beta
MC 1.19fabric
August 17, 2022

How to Install Armor Render Lib on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.19.2).

3

Install Mod

Open the mod browser in the dashboard and search for "Armor Render Lib". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.19.2, 1.19, 1.18.2

Server-side

Unsupported

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Armor Render Lib server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.19.2). You can switch loaders with one click in the panel.

Is Armor Render Lib compatible with fabric?

Armor Render Lib officially supports fabric for Minecraft 1.19.2, 1.19, 1.18.2. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Armor Render Lib – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Armor Render Lib consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Armor Render Lib with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Unsupported

Supported Versions

1.19.21.191.18.2