All Mods Resource Packs Data Packs Shaders Modpacks Plugins
Armor Render Lib

Armor Render Lib

by clevernucleus • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions
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.

How to Install Armor Render Lib (Mod)

Armor Render Lib by clevernucleus is verified for Fabric across Minecraft versions 1.18.2, 1.19, 1.19.2 (latest release: 0.2.6, file size: 28 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.18.2, 1.19, 1.19.2) and platform (Fabric).
  2. Make sure you have the compatible loader or environment installed for Fabric.
  3. Move the downloaded Armor Render Lib file into your Minecraft .minecraft/mods folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.19.2
Fabric
last yr. 1
1.19
Fabric
last yr. 1
1.18.2
Fabric
last yr. 1
1.19.2
Fabric
last yr. 1
1.19
Fabric
last yr. 1
1.18.2
Fabric
last yr. 1
1.19.2
Fabric
last yr. 1
1.19.2
Fabric
last yr. 1
1.19
Fabric
last yr. 1
1.18.2
Fabric
last yr. 1
[0.2.6] 0.2.6 by clevernucleus on Aug 30, 2022
Download
No changelog was specified.
[0.2.5] 0.2.5 by clevernucleus on Aug 30, 2022
Download
No changelog was specified.
[0.1.3] 0.1.3 by clevernucleus on Aug 30, 2022
Download
No changelog was specified.
[0.2.4] 0.2.4 by clevernucleus on Aug 17, 2022
Download
No changelog was specified.
[0.2.3] 0.2.3 by clevernucleus on Aug 17, 2022
Download
No changelog was specified.
[0.1.2] 0.1.2 by clevernucleus on Aug 17, 2022
Download
No changelog was specified.
[0.2.2] 0.2.2 by clevernucleus on Aug 12, 2022
Download
No changelog was specified.
[0.2.1] 0.2.1 by clevernucleus on Aug 06, 2022
Download
No changelog was specified.
[0.2.0] 0.2.0 by clevernucleus on Aug 06, 2022
Download
No changelog was specified.
Armor Render Lib Icon
Download Armor Render Lib
Select game version
Select platform