Download ArmorRenderLib: Directors Cut — Minecraft Mods — MetaMods

ArmorRenderLib: Directors Cut

Active

Downloads

0

Last update

1 year ago

Versions

1.20.1
Client
Fabric
Decor
Weapons and armor
Libraries

ArmorRenderLib: Directors Cut

ArmorRenderLib: Directors Cut is an updated version of a lightweight extension library for the fabric-rendering-v1 module from Fabric API. The standard Fabric API implementation has a high degree of abstraction, which makes it necessary to create a more specialized solution for certain usage scenarios.

Main Features

The library adds armor rendering layers - special objects containing dynamic textures, color parameters, and glow settings. These elements are responsible for displaying armor for specific items or groups of items. Unlike the basic Fabric API implementation, textures, colors, and effects can dynamically change depending on ItemStack, LivingEntity, and EquipmentSlot.

Project Integration

To connect the library to your project, add the following lines to the build.gradle file:

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>"
}

Usage Example

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);
    }
}

Working Features

  • Multiple different armor rendering layers can be attached to one item
  • One rendering layer can be used for several different items
  • Registering a rendering layer for standard armor items replaces their normal display
  • Compatibility with Cosmetic Armor and GeckoLib
  • Minimal use of mixins to ensure stable operation