package client.renderer.entity;

import org.lwjgl.opengl.GL11;

import client.renderer.GlState;
import client.renderer.model.ModelLeashKnot;
import common.entity.item.EntityLeashKnot;


public class RenderLeashKnot extends Render<EntityLeashKnot>
{
    private static final String leashKnotTextures = "textures/object/lead_knot.png";
    private ModelLeashKnot leashKnotModel = new ModelLeashKnot();

    public RenderLeashKnot(RenderManager renderManagerIn)
    {
        super(renderManagerIn);
    }

    /**
     * Renders the desired {@code T} type Entity.
     */
    public void doRender(EntityLeashKnot entity, double x, double y, double z, float partialTicks)
    {
        GL11.glPushMatrix();
        GlState.disableCull();
        GL11.glTranslatef((float)x, (float)y, (float)z);
        float f = 0.0625F;
        GlState.enableRescaleNormal();
        GL11.glScalef(-1.0F, -1.0F, 1.0F);
        GlState.enableAlpha();
        this.bindEntityTexture(entity);
        this.leashKnotModel.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f);
        GL11.glPopMatrix();
        super.doRender(entity, x, y, z, partialTicks);
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected String getEntityTexture(EntityLeashKnot entity)
    {
        return leashKnotTextures;
    }
}
