package client.renderer.layers;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;

import client.renderer.GlState;
import client.renderer.entity.RenderDragon;
import common.entity.animal.EntityDragon;


public class LayerEnderDragonEyes implements LayerRenderer<EntityDragon>
{
    private static final String TEXTURE = "textures/entity/dragon_eyes.png";
    private final RenderDragon dragonRenderer;

    public LayerEnderDragonEyes(RenderDragon dragonRendererIn)
    {
        this.dragonRenderer = dragonRendererIn;
    }

    public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
    {
        this.dragonRenderer.bindTexture(TEXTURE);
        GlState.enableBlend();
        GlState.disableAlpha();
        GlState.blendFunc(GL11.GL_ONE, GL11.GL_ONE);
        GlState.disableLighting();
        GlState.depthFunc(GL11.GL_EQUAL);
        int i = 61680;
        int j = i % 65536;
        int k = i / 65536;
        GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)j / 1.0F, (float)k / 1.0F);
        GlState.enableLighting();
        GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
        this.dragonRenderer.setLightmap(entitylivingbaseIn, partialTicks);
        GlState.disableBlend();
        GlState.enableAlpha();
        GlState.depthFunc(GL11.GL_LEQUAL);
    }

    public boolean shouldCombineTextures()
    {
        return false;
    }
}
