package client.renderer.layers;

import org.lwjgl.opengl.GL11;

import client.renderer.GlState;
import client.renderer.entity.RenderSlime;
import client.renderer.model.ModelBase;
import client.renderer.model.ModelSlime;
import common.entity.npc.EntityNPC;

public class LayerSlimeGel implements LayerRenderer<EntityNPC>
{
    private final RenderSlime slimeRenderer;
    private final ModelBase slimeModel = new ModelSlime(0);

    public LayerSlimeGel(RenderSlime slimeRendererIn)
    {
        this.slimeRenderer = slimeRendererIn;
    }

    public void doRenderLayer(EntityNPC 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)
    {
//        if (!entitylivingbaseIn.isInvisible())
//        {
        GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlState.enableNormalize();
        GlState.enableBlend();
        GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        this.slimeModel.setModelAttributes(this.slimeRenderer.getMainModel());
        this.slimeModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
        GlState.disableBlend();
        GlState.disableNormalize();
//        }
    }

    public boolean shouldCombineTextures()
    {
        return true;
    }
}
