package com.zivilon.cinder_loe.client.render;

import com.zivilon.cinder_loe.entity.Wraith;
import lotr.client.LOTRSpeechClient;
import lotr.client.model.LOTRModelGollum;
import lotr.client.model.LOTRModelMarshWraith;
import lotr.client.render.entity.LOTRNPCRendering;
import lotr.common.entity.npc.LOTREntityGollum;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;

public class RenderMonkey extends RenderLiving {
    private static ResourceLocation skin = new ResourceLocation("cinder_loe:mob/monkey.png");

    public RenderMonkey() {
        super((ModelBase) new LOTRModelGollum(), 0.5f);
    }

    protected ResourceLocation getEntityTexture(Entity entity) {
        return skin;
    }

    protected void preRenderCallback(EntityLivingBase entity, float f) {
        float scale = 0.85f;
        GL11.glScalef((float) scale, (float) scale, (float) scale);
    }

    public void doRender(EntityLiving entity, double d, double d1, double d2, float f, float f1) {
        LOTREntityGollum gollum = (LOTREntityGollum)entity;
        super.doRender((EntityLiving)gollum, d, d1, d2, f, f1);
        if (Minecraft.isGuiEnabled()) {
            if (gollum.getGollumOwner() == Minecraft.getMinecraft().thePlayer) {
                LOTRNPCRendering.renderNPCHealthBar((EntityLivingBase)entity, d, d1 + 0.5, d2);
            }
        }

    }
}
