Goodbird-git / Geckolib-Unofficial-1.7.10

Unofficial version of Geckolib for 1.7.10 version
Other
15 stars 3 forks source link

Custom Armor Rendering? #8

Open NiNuNa opened 1 month ago

NiNuNa commented 1 month ago

Hey there! I've been trying to implement custom rendered armour for hours now, but it doesn't seem to be working, do GeoArmorRenderer's work already or am I doing something wrong?

image

image

image

image

Goodbird-git commented 1 month ago

Hello-hello! It would be really nice if you could send the mod source (or at least the required classes, model, texture and animation files) to my discord (my discord tag is .goodbird) Then I'll be able to debug it and tell what went wrong Since geckolib modeled armor should work

Goodbird-git commented 1 month ago

The solution is to add

@Nullable
    @SideOnly(Side.CLIENT)
    public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
        Class<? extends ItemArmor> clazz = this.getClass();
        GeoArmorRenderer renderer = GeoArmorRenderer.getRenderer(clazz);
        renderer.setCurrentItem(entityLiving, itemStack, armorSlot);
        renderer.applyEntityStats(entityLiving).applySlot(armorSlot);
        return renderer;
    }

    @Nullable
    @SideOnly(Side.CLIENT)
    public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
        Class<? extends ItemArmor> clazz = this.getClass();
        GeoArmorRenderer renderer = GeoArmorRenderer.getRenderer(clazz);
        return renderer.getTextureLocation((ItemArmor)stack.getItem()).toString();
    }

to LostTalesItemTestArmor class