summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java
blob: f9da0daa7b244e43896c75d72810159f6f0e5eef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package darkknight.jewelrycraft.entities.renders;

import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import darkknight.jewelrycraft.entities.EntityHeart;
import darkknight.jewelrycraft.util.Variables;

/**
 * @author Sorin
 */
public class HeartRender extends RenderLiving
{
    protected ResourceLocation texture;

    public HeartRender(ModelBase modelBase, float shadowSize)
    {
        super(modelBase, shadowSize);
    }
 
    @Override
    protected void preRenderCallback(EntityLivingBase entity, float f)
    {
        preRenderCallbackHeart((EntityHeart) entity, f);
    }
  
    protected void preRenderCallbackHeart(EntityHeart entity, float f)
    {
        GL11.glScalef(0.4F, 0.4F, 0.4F);
        GL11.glRotatef(55F, 1F, 0F, 0F);
        String type = entity.getType();
        if(type == "" || type == null) type = "Red";
        texture = new ResourceLocation(Variables.MODID, "textures/entities/"+type+"Heart.png");
    }

    @Override
    protected ResourceLocation getEntityTexture(Entity par1Entity)
    {
        return texture;
    }
}