Кастомная броня на НПС

Версия Minecraft
1.7.10
643
6
14
Есть броня, сделанная на основе рендерплеерапи, но кастом нпс при одевании ничего не рендерит.

Моя интуиция говорит мне что надо добавить рендер в RenderNPCHumanMale или же RenderCustomNpc.
Не подскажите, как лучше всего это сделать?

Да, совсем забыл.

RenderNPCHumanMale:
package noppes.npcs.client.renderer;

import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;

import org.lwjgl.opengl.GL11;

import com.undead.server.items.ItemArmors;

import net.minecraft.block.Block;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import noppes.npcs.client.model.ModelNPCMale;
import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.items.ItemClaw;
import noppes.npcs.items.ItemShield;

public class RenderNPCHumanMale extends RenderNPCInterface
{

    private ModelNPCMale modelBipedMain;
    protected ModelNPCMale modelArmorChestplate;
    protected ModelNPCMale modelArmor;

    public RenderNPCHumanMale(ModelNPCMale mainmodel, ModelNPCMale armorChest, ModelNPCMale armor)
    {
        super(mainmodel, 0.5F);
        modelBipedMain = mainmodel;
        modelArmorChestplate = armorChest;
        modelArmor = armor;
    }

    protected int func_130006_a(EntityLiving par1EntityLiving, int par2, float par3)
    {
        ItemStack itemstack = par1EntityLiving.func_130225_q(3 - par2);

        if (itemstack != null)
        {
            Item item = itemstack.getItem();

            if (item instanceof ItemArmor)
            {
                ItemArmor itemarmor = (ItemArmor)item;
                this.bindTexture(RenderBiped.getArmorResource(par1EntityLiving, itemstack, par2, null));
                ModelBiped modelbiped = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
                modelbiped.bipedHead.showModel = par2 == 0;
                modelbiped.bipedHeadwear.showModel = par2 == 0;
                modelbiped.bipedBody.showModel = par2 == 1 || par2 == 2;
                modelbiped.bipedRightArm.showModel = par2 == 1;
                modelbiped.bipedLeftArm.showModel = par2 == 1;
                modelbiped.bipedRightLeg.showModel = par2 == 2 || par2 == 3;
                modelbiped.bipedLeftLeg.showModel = par2 == 2 || par2 == 3;
                modelbiped = ForgeHooksClient.getArmorModel(par1EntityLiving, itemstack, par2, modelbiped);
                this.setRenderPassModel(modelbiped);
                modelbiped.onGround = this.mainModel.onGround;
                modelbiped.isRiding = this.mainModel.isRiding;
                modelbiped.isChild = this.mainModel.isChild;
                float f1 = 1.0F;

                //Move out of if to allow for more then just CLOTH to have color
                int j = itemarmor.getColor(itemstack);
                if (j != -1)
                {
                    float f2 = (float)(j >> 16 & 255) / 255.0F;
                    float f3 = (float)(j >> 8 & 255) / 255.0F;
                    float f4 = (float)(j & 255) / 255.0F;
                    GL11.glColor3f(f1 * f2, f1 * f3, f1 * f4);

                    if (itemstack.isItemEnchanted())
                    {
                        return 31;
                    }

                    return 16;
                }

                GL11.glColor3f(f1, f1, f1);

                if (itemstack.isItemEnchanted())
                {
                    return 15;
                }

                return 1;
            }
        }

        return -1;
    }
    @Override
    protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3){
        return this.func_130006_a((EntityLiving)par1EntityLivingBase, par2, par3);
    }

    public void renderPlayer(EntityNPCInterface npc, double d, double d1, double d2,
            float f, float f1)
    {
        ItemStack itemstack = npc.getHeldItem();
        modelArmorChestplate.heldItemRight = modelArmor.heldItemRight = modelBipedMain.heldItemRight =
                itemstack == null ? 0 : npc.hurtResistantTime > 0 ? 3 : 1;

        modelArmorChestplate.heldItemLeft = modelArmor.heldItemLeft = modelBipedMain.heldItemLeft =
                npc.getOffHand() == null ? 0 : npc.hurtResistantTime > 0 ? 3 : 1;
        
        modelArmorChestplate.isSneak = modelArmor.isSneak = modelBipedMain.isSneak = npc.isSneaking();

        modelArmorChestplate.isSleeping = modelArmor.isSleeping = modelBipedMain.isSleeping = npc.isPlayerSleeping();
        modelArmorChestplate.isDancing = modelArmor.isDancing = modelBipedMain.isDancing = npc.currentAnimation == EnumAnimation.DANCING;
        modelArmorChestplate.aimedBow = modelArmor.aimedBow = modelBipedMain.aimedBow = npc.currentAnimation == EnumAnimation.AIMING;
        
        modelArmorChestplate.isRiding = modelArmor.isRiding = modelBipedMain.isRiding = npc.isRiding();
        
        double d3 = d1 - (double)npc.yOffset;
        if(npc.isSneaking())
        {
            d3 -= 0.125D;
        }
        super.doRender(npc, d, d3, d2, f, f1);
        modelArmorChestplate.aimedBow = modelArmor.aimedBow = modelBipedMain.aimedBow = false;
        modelArmorChestplate.isSneak = modelArmor.isSneak = modelBipedMain.isSneak = false;
        modelArmorChestplate.heldItemRight = modelArmor.heldItemRight = modelBipedMain.heldItemRight = 0;
        modelArmorChestplate.heldItemLeft = modelArmor.heldItemLeft = modelBipedMain.heldItemLeft = 0;
    }

    protected void renderSpecials(EntityNPCInterface npc, float f)
    {
        super.renderEquippedItems(npc, f);
        GL11.glColor3f(1,1,1);
        int i = npc.getBrightnessForRender(f);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        if (!npc.display.cloakTexture.isEmpty())
        {
            if(npc.textureCloakLocation == null){
                npc.textureCloakLocation = new ResourceLocation(npc.display.cloakTexture);
            }
            bindTexture((ResourceLocation) npc.textureCloakLocation);
            //AbstractClientPlayer.func_110307_b(, null);
            GL11.glPushMatrix();
            GL11.glTranslatef(0.0F, 0.0F, 0.125F);
            double d = (npc.field_20066_r + (npc.field_20063_u - npc.field_20066_r) * (double)f) - (npc.prevPosX + (npc.posX - npc.prevPosX) * (double)f);
            double d1 = (npc.field_20065_s + (npc.field_20062_v - npc.field_20065_s) * (double)f) - (npc.prevPosY + (npc.posY - npc.prevPosY) * (double)f);
            double d2 = (npc.field_20064_t + (npc.field_20061_w - npc.field_20064_t) * (double)f) - (npc.prevPosZ + (npc.posZ - npc.prevPosZ) * (double)f);
            float f11 = npc.prevRenderYawOffset + (npc.renderYawOffset - npc.prevRenderYawOffset) * f;
            double d3 = MathHelper.sin((f11 * 3.141593F) / 180F);
            double d4 = -MathHelper.cos((f11 * 3.141593F) / 180F);
            float f14 = (float)(d * d3 + d2 * d4) * 100F;
            float f15 = (float)(d * d4 - d2 * d3) * 100F;
            if (f14 < 0.0F)
            {
                f14 = 0.0F;
            }
            float f16 = npc.prevRotationYaw + (npc.rotationYaw - npc.prevRotationYaw) * f;
            //f13 += MathHelper.sin((entityplayer.prevDistanceWalkedModified + (entityplayer.distanceWalkedModified - entityplayer.prevDistanceWalkedModified) * f) * 6F) * 32F * f16;
            float f13 = 5f;
            if (npc.isSneaking())
            {
                f13 += 25F;
            }
            //System.out.println(entityplayer.prevDistanceWalkedModified);
            GL11.glRotatef(6F + f14 / 2.0F + f13, 1.0F, 0.0F, 0.0F);
            GL11.glRotatef(f15 / 2.0F, 0.0F, 0.0F, 1.0F);
            GL11.glRotatef(-f15 / 2.0F, 0.0F, 1.0F, 0.0F);
            GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
            modelBipedMain.renderCloak(0.0625F);

            GL11.glPopMatrix();
        }
        GL11.glColor3f(1,1,1);
        ItemStack itemstack = npc.inventory.armorItemInSlot(0);
        if(itemstack != null)
        {
            GL11.glPushMatrix();
            if(npc instanceof EntityCustomNpc){
                EntityCustomNpc cnpc = (EntityCustomNpc) npc;
                GL11.glTranslatef(0, cnpc.modelData.getBodyY(), 0);
                this.modelBipedMain.bipedHead.postRender(0.0625F);
                GL11.glScalef(cnpc.modelData.head.scaleX, cnpc.modelData.head.scaleY, cnpc.modelData.head.scaleZ);
            }
            else
                this.modelBipedMain.bipedHead.postRender(0.0625F);

            IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
            boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

            if (itemstack.getItem() instanceof ItemBlock)
            {
                if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType()))
                {
                    float var6 = 0.625F;
                    GL11.glTranslatef(0.0F, -0.25F, 0.0F);
                    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
                    GL11.glScalef(var6, -var6, -var6);
                }

                this.renderManager.itemRenderer.renderItem(npc, itemstack, 0);
            }

            GL11.glPopMatrix();
        }
        GL11.glColor3f(1,1,1);
        ItemStack itemstack2 = npc.getHeldItem();
        if(itemstack2 != null)
        {
            float var6;
            GL11.glPushMatrix();
            float y = 0;
            float x = 0;
            if(npc instanceof EntityCustomNpc){
                EntityCustomNpc cnpc = (EntityCustomNpc) npc;
                y = (cnpc.modelData.arms.scaleY - 1) * 0.7f;
                x = (1 - cnpc.modelData.body.scaleX) * 0.28f + (1 - cnpc.modelData.arms.scaleX) * 0.175f;
                GL11.glTranslatef(x, cnpc.modelData.getBodyY(), 0);
            }
            this.modelBipedMain.bipedRightArm.postRender(0.0625F);
            GL11.glTranslatef(-0.0625F, 0.4375F + y, 0.0625F);

            IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack2, EQUIPPED);
            boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack2, BLOCK_3D));
            
            if (itemstack2.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack2.getItem()).getRenderType())))
            {
                var6 = 0.5F;
                GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
                var6 *= 0.75F;
                GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
                GL11.glScalef(-var6, -var6, var6);
            }
            else if (itemstack2.getItem() == Items.bow)
            {
                var6 = 0.625F;
                GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
                GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
                GL11.glScalef(var6, -var6, var6);
                GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
            }
            else if (itemstack2.getItem().isFull3D())
            {
                var6 = 0.625F;

                if (itemstack2.getItem().shouldRotateAroundWhenRendering())
                {
                    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
                    GL11.glTranslatef(0.0F, -0.125F, 0.0F);
                }
                
                if (npc.hurtResistantTime > 0 && npc.stats.resistances.playermelee > 1f)
                {
                    GL11.glTranslatef(0.05F, 0.0F, -0.1F);
                    GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F);
                    GL11.glRotatef(-10.0F, 1.0F, 0.0F, 0.0F);
                    GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F);
                }

                GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
                GL11.glScalef(var6, -var6, var6);
                GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
            }
            else
            {
                var6 = 0.375F;
                GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
                GL11.glScalef(var6, var6, var6);
                GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
                GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
            }

            if (itemstack2.getItem().requiresMultipleRenderPasses())
            {
                for (int var25 = 0; var25 < itemstack2.getItem().getRenderPasses(itemstack2.getItemDamage()); ++var25)
                {
                    int var24 = itemstack2.getItem().getColorFromItemStack(itemstack2, var25);
                    float var26 = (float)(var24 >> 16 & 255) / 255.0F;
                    float var9 = (float)(var24 >> 8 & 255) / 255.0F;
                    float var10 = (float)(var24 & 255) / 255.0F;
                    GL11.glColor4f(var26, var9, var10, 1.0F);
                    this.renderManager.itemRenderer.renderItem(npc, itemstack2, var25);
                }
            }
            else
                renderManager.itemRenderer.renderItem(npc, itemstack2, 0);
            
            GL11.glPopMatrix();
        }
        GL11.glColor4f(1, 1, 1, 1.0F);
        itemstack2 = npc.getOffHand();
        if(itemstack2 != null)
        {
            GL11.glPushMatrix();
            float y = 0;
            float x = 0;
            if(npc instanceof EntityCustomNpc){
                EntityCustomNpc cnpc = (EntityCustomNpc) npc;
                y = (cnpc.modelData.arms.scaleY - 1) * 0.7f;
                x = (1 - cnpc.modelData.body.scaleX) * -0.28f + (1 - cnpc.modelData.arms.scaleX) * -0.175f;
                GL11.glTranslatef(x, cnpc.modelData.getBodyY(), 0);
            }
            this.modelBipedMain.bipedLeftArm.postRender(0.0625F);
            GL11.glTranslatef(0.0625F, 0.4375F + y, 0.0625F);
            float var6;
            
            IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack2, EQUIPPED);
            boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack2, BLOCK_3D));
            
            if(itemstack2.getItem() instanceof ItemShield || itemstack2.getItem() instanceof ItemClaw)
                GL11.glTranslatef(0.30f, 0, 0f);
            
            
            if (itemstack2.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack2.getItem()).getRenderType())))
            {
                var6 = 0.5F;
                GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
                var6 *= 0.75F;
                GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
                GL11.glScalef(var6, -var6, var6);
            }
            else if (itemstack2.getItem() == Items.bow)
            {
                var6 = 0.625F;
                GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
                GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
                GL11.glScalef(var6, -var6, var6);
                GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
            }
            else if (itemstack2.getItem().isFull3D())
            {
                var6 = 0.625F;

                if (itemstack2.getItem().shouldRotateAroundWhenRendering())
                {
                    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
                    GL11.glTranslatef(0.0F, -0.125F, 0.0F);
                }
                
                if (npc.hurtResistantTime > 0 && npc.stats.resistances.arrow > 1f)
                {
                    GL11.glTranslatef(0.05F, 0.0F, -0.1F);
                    GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
                    GL11.glRotatef(-10.0F, 1.0F, 0.0F, 0.0F);
                    GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
                }

                GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
                GL11.glScalef(var6, -var6, var6);
                GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
            }
            else
            {
                var6 = 0.375F;
                GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
                GL11.glScalef(var6, var6, var6);
                GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
                GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
            }

            if (itemstack2.getItem().requiresMultipleRenderPasses())
            {
                for (int var25 = 0; var25 < itemstack2.getItem().getRenderPasses(itemstack2.getItemDamage()); ++var25)
                {
                    int var24 = itemstack2.getItem().getColorFromItemStack(itemstack2, var25);
                    float var26 = (float)(var24 >> 16 & 255) / 255.0F;
                    float var9 = (float)(var24 >> 8 & 255) / 255.0F;
                    float var10 = (float)(var24 & 255) / 255.0F;
                    GL11.glColor4f(var26, var9, var10, 1.0F);
                    this.renderManager.itemRenderer.renderItem(npc, itemstack2, var25);
                }
            }else
            {
                renderManager.itemRenderer.renderItem(npc, itemstack2, 0);
            }
            GL11.glPopMatrix();
        }
    }

    @Override
    protected void renderEquippedItems(EntityLivingBase entityliving, float f){
        renderSpecials((EntityNPCInterface)entityliving, f);
    }

    @Override
    public void doRender(EntityLiving entityliving, double d, double d1, double d2, float f, float f1){
        renderPlayer((EntityNPCInterface)entityliving, d, d1, d2, f, f1);
    }

    @Override
    public void doRender(Entity entity, double d, double d1, double d2, float f, float f1){
        renderPlayer((EntityNPCInterface)entity, d, d1, d2, f, f1);
    }

}

RenderCustomNPC:
package noppes.npcs.client.renderer;

import java.lang.reflect.Method;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.NPCRendererHelper;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RendererLivingEntity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.util.ModelRenderPassHelper;
import noppes.npcs.controllers.PixelmonHelper;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCInterface;

import org.lwjgl.opengl.GL11;

public class RenderCustomNpc extends RenderNPCHumanMale{

    private RendererLivingEntity renderEntity;
    private EntityLivingBase entity;
    
    private ModelRenderPassHelper renderpass = new ModelRenderPassHelper();
    
    public RenderCustomNpc() {
        super(new ModelMPM(0), new ModelMPM(1), new ModelMPM(0.5f));
    }
    
    @Override
    public void renderPlayer(EntityNPCInterface npcInterface, double d, double d1, double d2, float f, float f1){
        EntityCustomNpc npc = (EntityCustomNpc) npcInterface;
        entity = npc.modelData.getEntity(npc);
        ModelBase model = null;
        renderEntity = null;
        if(entity != null){
            renderEntity = (RendererLivingEntity) RenderManager.instance.getEntityRenderObject(entity);
            model = NPCRendererHelper.getMainModel(renderEntity);
            if(PixelmonHelper.isPixelmon(entity)){
                try {
                    Class c = Class.forName("com.pixelmonmod.pixelmon.entities.pixelmon.Entity2HasModel");
                    Method m = c.getMethod("getModel");
                    model = (ModelBase) m.invoke(entity);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if(EntityList.getEntityString(entity).equals("doggystyle.Dog")){
                try {
                    Method m = entity.getClass().getMethod("getBreed");
                    Object breed = m.invoke(entity);
                    m = breed.getClass().getMethod("getModel");
                    model = (ModelBase) m.invoke(breed);
                    model.getClass().getMethod("setPosition", int.class).invoke(model, 0);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            renderPassModel = renderpass;
            renderpass.renderer = renderEntity;
            renderpass.entity = entity;
        }
        ((ModelMPM)this.modelArmor).entityModel = model;
        ((ModelMPM)this.modelArmor).entity = entity;

        ((ModelMPM)this.modelArmorChestplate).entityModel = model;
        ((ModelMPM)this.modelArmorChestplate).entity = entity;

        ((ModelMPM)this.mainModel).entityModel = model;
        ((ModelMPM)this.mainModel).entity = entity;
        
        super.renderPlayer(npc, d, d1, d2, f, f1);

    }   
    
    @Override
    protected void renderEquippedItems(EntityLivingBase entityliving, float f){
        if(renderEntity != null)
            NPCRendererHelper.renderEquippedItems(entity, f, renderEntity);
        else
            super.renderEquippedItems(entityliving, f);
    }

    @Override
    protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3){
        if(renderEntity != null){
            return NPCRendererHelper.shouldRenderPass(entity, par2, par3, renderEntity);
        }
        return this.func_130006_a((EntityLiving)par1EntityLivingBase, par2, par3);
    }
    
    @Override
    protected void preRenderCallback(EntityLivingBase entityliving, float f){
        if(renderEntity != null){
            EntityNPCInterface npc = (EntityNPCInterface) entityliving;
            int size = npc.display.modelSize;
            if(entity instanceof EntityNPCInterface){
                ((EntityNPCInterface)entity).display.modelSize = 5;
            }
            NPCRendererHelper.preRenderCallback(entity, f, renderEntity);
            npc.display.modelSize = size;
            GL11.glScalef(0.2f * npc.display.modelSize, 0.2f * npc.display.modelSize, 0.2f * npc.display.modelSize);
        }
        else
            super.preRenderCallback(entityliving, f);
    }

    @Override
    protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2){
        if(renderEntity != null){
            return NPCRendererHelper.handleRotationFloat(entity, par2, renderEntity);
        }
        return super.handleRotationFloat(par1EntityLivingBase, par2);
    }
}
 
643
6
14
К сожалению это не тот метод, но я нашел унаследованный от Модели.

ModelNPCMale:
package noppes.npcs.client.model;

import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import noppes.npcs.CustomNpcs;
import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.entity.EntityNPCInterface;

import org.lwjgl.opengl.GL11;

import com.undead.client.utils.ModelList;
import com.undead.server.items.ItemArmors;

public class ModelNPCMale extends ModelBiped
{
    public boolean isDancing;
    public boolean isSleeping;
    
    public float animationTick;
    public float dancingTicks;

    public ModelNPCMale(float f)
    {
        init(f, 0.0F);
    }
    @Override
    public void setLivingAnimations(EntityLivingBase par1EntityLiving, float f6, float f5, float par9){
        animationTick += par9;
        dancingTicks = CustomNpcs.ticks / 3.978873F;
    }
    public void init(float f, float f1)
    {
        heldItemLeft = 0;
        heldItemRight = 0;
        isSneak = false;
        aimedBow = false;
        bipedCloak = new ModelRenderer(this, 0, 0);
        bipedCloak.textureHeight = 32;
        bipedCloak.addBox(-5F, 0.0F, -1F, 10, 16, 1, f);
        
        bipedEars = new ModelRenderer(this, 24, 0);
        bipedEars.addBox(-3F, -6F, -1F, 6, 6, 1, f);
        
        bipedHead = new ModelRenderer(this, 0, 0);
        bipedHead.addBox(-4F, -8F, -4F, 8, 8, 8, f);
        bipedHead.setRotationPoint(0.0F, 0.0F + f1, 0.0F);
        
        bipedHeadwear = new ModelRenderer(this, 32, 0);
        bipedHeadwear.addBox(-4F, -8F, -4F, 8, 8, 8, f + 0.5F);
        bipedHeadwear.setRotationPoint(0.0F, 0.0F + f1, 0.0F);
        bipedBody = new ModelRenderer(this, 16, 16);
        bipedBody.addBox(-4F, 0.0F, -2F, 8, 12, 4, f);
        bipedBody.setRotationPoint(0.0F, 0.0F + f1, 0.0F);
        bipedRightArm = new ModelRenderer(this, 40, 16);
        bipedRightArm.addBox(-3F, -2F, -2F, 4, 12, 4, f);
        bipedRightArm.setRotationPoint(-5F, 2.0F + f1, 0.0F);
        bipedLeftArm = new ModelRenderer(this, 40, 16);
        bipedLeftArm.mirror = true;
        bipedLeftArm.addBox(-1F, -2F, -2F, 4, 12, 4, f);
        bipedLeftArm.setRotationPoint(5F, 2.0F + f1, 0.0F);
        bipedRightLeg = new ModelRenderer(this, 0, 16);
        bipedRightLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f);
        bipedRightLeg.setRotationPoint(-2F, 12F + f1, 0.0F);
        bipedLeftLeg = new ModelRenderer(this, 0, 16);
        bipedLeftLeg.mirror = true;
        bipedLeftLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f);
        bipedLeftLeg.setRotationPoint(2.0F, 12F + f1, 0.0F);
        
    }

    @Override
    public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){
        setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
        if(!isDancing){
            bipedHead.render(par7);
            bipedBody.render(par7);
            bipedRightArm.render(par7);
            bipedLeftArm.render(par7);
            bipedRightLeg.render(par7);
            bipedLeftLeg.render(par7);
            bipedHeadwear.render(par7);
        }
        else{
            renderHead(par1Entity, par7);
            renderArms(par1Entity, par7);
            renderBody(par1Entity, par7);
            renderLegs(par1Entity, par7);
        }
    }
    public void renderHead(Entity entityliving,float par7){
        if(isDancing){
            GL11.glPushMatrix();
            GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.075F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancingTicks))) * 0.075F);
            bipedHead.render(par7);
            bipedHeadwear.render(par7);
            GL11.glPopMatrix();
        }
        else{       
            bipedHead.render(par7);
            bipedHeadwear.render(par7);
        }
    }
    public void renderLeftArm(Entity entityliving,float par7){
        if(isDancing){
            GL11.glPushMatrix();
            GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F);
            bipedLeftArm.render(par7);
            GL11.glPopMatrix();
        }
        else{       
            bipedLeftArm.render(par7);
        }
    }
    public void renderArms(Entity entity,float par7){
        renderLeftArm(entity,par7);
        renderRightArm(entity,par7);
    }
    public void renderRightArm(Entity entityliving,float par7){
        if(isDancing){
            GL11.glPushMatrix();
            GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F);
            bipedRightArm.render(par7);
            GL11.glPopMatrix();
        }
        else{       
            bipedRightArm.render(par7);
        }
    }
    public void renderBody(Entity entityliving,float par7){
        if(isDancing){
            GL11.glPushMatrix();
            GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.015F, 0.0F, 0.0F);
            bipedBody.render(par7);
            GL11.glPopMatrix();
        }
        else{       
            bipedBody.render(par7);
        }
    }
    public void renderLegs(Entity entityliving,float par7){
        bipedRightLeg.render(par7);
        bipedLeftLeg.render(par7);
    }
    
    public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity)
    {
        EntityNPCInterface npc = (EntityNPCInterface) entity;
        isRiding = npc.isRiding();
        
        
        if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING))
            isSneak = false;
        bipedHead.rotateAngleY = par4 / (180F / (float)Math.PI);
        bipedHead.rotateAngleX = par5 / (180F / (float)Math.PI);
        bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY;
        bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX;
        bipedRightArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F;
        bipedLeftArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;
        bipedRightArm.rotateAngleZ = 0.0F;
        bipedLeftArm.rotateAngleZ = 0.0F;
        bipedRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
        bipedLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
        bipedRightLeg.rotateAngleY = 0.0F;
        bipedLeftLeg.rotateAngleY = 0.0F;
        
        if (isRiding)
        {
            bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
            bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F);
            bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F);
            bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F);
            bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F);
            bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F);
        }

        if (heldItemLeft != 0)
        {
            bipedLeftArm.rotateAngleX = bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)heldItemLeft;
        }

        if (heldItemRight != 0)
        {
            bipedRightArm.rotateAngleX = bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)heldItemRight;
        }

        bipedRightArm.rotateAngleY = 0.0F;
        bipedLeftArm.rotateAngleY = 0.0F;

        if (onGround > -9990F)
        {
            float f = onGround;
            bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f) * (float)Math.PI * 2.0F) * 0.2F;
            bipedRightArm.rotationPointZ = MathHelper.sin(bipedBody.rotateAngleY) * 5F;
            bipedRightArm.rotationPointX = -MathHelper.cos(bipedBody.rotateAngleY) * 5F;
            bipedLeftArm.rotationPointZ = -MathHelper.sin(bipedBody.rotateAngleY) * 5F;
            bipedLeftArm.rotationPointX = MathHelper.cos(bipedBody.rotateAngleY) * 5F;
            bipedRightArm.rotateAngleY += bipedBody.rotateAngleY;
            bipedLeftArm.rotateAngleY += bipedBody.rotateAngleY;
            bipedLeftArm.rotateAngleX += bipedBody.rotateAngleY;
            f = 1.0F - onGround;
            f *= f;
            f *= f;
            f = 1.0F - f;
            float f2 = MathHelper.sin(f * (float)Math.PI);
            float f4 = MathHelper.sin(onGround * (float)Math.PI) * -(bipedHead.rotateAngleX - 0.7F) * 0.75F;
            bipedRightArm.rotateAngleX -= (double)f2 * 1.2D + (double)f4;
            bipedRightArm.rotateAngleY += bipedBody.rotateAngleY * 2.0F;
            bipedRightArm.rotateAngleZ = MathHelper.sin(onGround * (float)Math.PI) * -0.4F;
        }

        if (isSneak)
        {
            bipedBody.rotateAngleX = 0.5F;
            bipedRightLeg.rotateAngleX -= 0.0F;
            bipedLeftLeg.rotateAngleX -= 0.0F;
            bipedRightArm.rotateAngleX += 0.4F;
            bipedLeftArm.rotateAngleX += 0.4F;
            bipedRightLeg.rotationPointZ = 4F;
            bipedLeftLeg.rotationPointZ = 4F;
            bipedRightLeg.rotationPointY = 9F;
            bipedLeftLeg.rotationPointY = 9F;
            bipedHead.rotationPointY = 1.0F;
        }
        else
        {
            bipedBody.rotateAngleX = 0.0F;
            bipedRightLeg.rotationPointZ = 0.0F;
            bipedLeftLeg.rotationPointZ = 0.0F;
            bipedRightLeg.rotationPointY = 12F;
            bipedLeftLeg.rotationPointY = 12F;
            bipedHead.rotationPointY = 0.0F;
        }

        bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
        bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
        bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
        bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;

        if (aimedBow)
        {
            float f1 = 0.0F;
            float f3 = 0.0F;
            bipedRightArm.rotateAngleZ = 0.0F;
            bipedLeftArm.rotateAngleZ = 0.0F;
            bipedRightArm.rotateAngleY = -(0.1F - f1 * 0.6F) + bipedHead.rotateAngleY;
            bipedLeftArm.rotateAngleY = (0.1F - f1 * 0.6F) + bipedHead.rotateAngleY + 0.4F;
            bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + bipedHead.rotateAngleX;
            bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + bipedHead.rotateAngleX;
            bipedRightArm.rotateAngleX -= f1 * 1.2F - f3 * 0.4F;
            bipedLeftArm.rotateAngleX -= f1 * 1.2F - f3 * 0.4F;
            bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
            bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
            bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
            bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
        }
    }

    public void renderEars(float f)
    {
        bipedEars.rotateAngleY = bipedHead.rotateAngleY;
        bipedEars.rotateAngleX = bipedHead.rotateAngleX;
        bipedEars.rotationPointX = 0.0F;
        bipedEars.rotationPointY = 0.0F;
        bipedEars.render(f);
    }

    public void setRotation(ModelRenderer model, float x, float y, float z)
    {
      model.rotateAngleX = x;
      model.rotateAngleY = y;
      model.rotateAngleZ = z;
    }
    
    public void renderCloak(float f)
    {
        bipedCloak.render(f);
    }

    public boolean isSleeping(Entity entity) {
        if(entity instanceof EntityPlayer && ((EntityPlayer)entity).isPlayerSleeping())
            return true;
        return ((EntityNPCInterface)entity).currentAnimation == EnumAnimation.LYING;
    }
}

Еще методом тыка нашел такую шнягу.
RenderCustomNPC:
    @Override
    protected void renderEquippedItems(EntityLivingBase entityliving, float f){
        if(renderEntity != null)
            NPCRendererHelper.renderEquippedItems(entity, f, renderEntity);
        else
            super.renderEquippedItems(entityliving, f);
    }
 
Сверху