package client.renderer.entity;

import org.lwjgl.opengl.GL11;

import client.Client;
import client.renderer.model.ModelDie;
import client.renderer.texture.TextureMap;
import common.entity.projectile.EntityDie;
import common.model.Transforms.Camera;

public class RenderDie extends Render<EntityDie>
{
    private final ModelDie model = new ModelDie();

    public RenderDie(RenderManager renderManagerIn)
    {
        super(renderManagerIn);
//        this.shadowSize = 0.09F;
    }
    
    protected String getEntityTexture(EntityDie entity)
    {
        return TextureMap.BLOCKS;
    }
    
    public void doRender(EntityDie entity, double x, double y, double z, float partialTicks)
    {
//        BlockRendererDispatcher blockrendererdispatcher = Game.getClient().getBlockRendererDispatcher();
        GL11.glPushMatrix();
        GL11.glTranslatef((float)x, (float)y + 0.05F, (float)z);
        this.bindEntityTexture(entity);
        if(entity.getValue() == 0)
			GL11.glRotatef((float)((entity.ticksExisted % 10) * (360 / 10)), 0.3f, 0.4f, 0.1f);
//        GlState.translate(-0.05F, -0.05F, 0.05F);
        GL11.glScalef(0.5f, 0.5f, 0.5f);
        Client.CLIENT.getRenderItem().renderItem(entity.getStack(), Camera.GROUND);
//        blockrendererdispatcher.renderBlockBrightness(Blocks.planks.getDefaultState(), entity.getBrightness(partialTicks));
        GL11.glPopMatrix();
        super.doRender(entity, x, y, z, partialTicks);
    }

//    protected boolean canRenderName(EntityDie entity)
//    {
//        return entity.getValue() != 0 || super.canRenderName(entity);
//    }
}
