001package net.minecraft.client.renderer.entity;
002
003import cpw.mods.fml.relauncher.Side;
004import cpw.mods.fml.relauncher.SideOnly;
005import net.minecraft.client.model.ModelBase;
006import net.minecraft.entity.Entity;
007import net.minecraft.entity.EntityLiving;
008import net.minecraft.entity.passive.EntitySquid;
009import org.lwjgl.opengl.GL11;
010
011@SideOnly(Side.CLIENT)
012public class RenderSquid extends RenderLiving
013{
014    public RenderSquid(ModelBase par1ModelBase, float par2)
015    {
016        super(par1ModelBase, par2);
017    }
018
019    /**
020     * Renders the Living Squid.
021     */
022    public void renderLivingSquid(EntitySquid par1EntitySquid, double par2, double par4, double par6, float par8, float par9)
023    {
024        super.doRenderLiving(par1EntitySquid, par2, par4, par6, par8, par9);
025    }
026
027    /**
028     * Rotates the Squid's corpse.
029     */
030    protected void rotateSquidsCorpse(EntitySquid par1EntitySquid, float par2, float par3, float par4)
031    {
032        float var5 = par1EntitySquid.field_70862_e + (par1EntitySquid.field_70861_d - par1EntitySquid.field_70862_e) * par4;
033        float var6 = par1EntitySquid.field_70860_g + (par1EntitySquid.field_70859_f - par1EntitySquid.field_70860_g) * par4;
034        GL11.glTranslatef(0.0F, 0.5F, 0.0F);
035        GL11.glRotatef(180.0F - par3, 0.0F, 1.0F, 0.0F);
036        GL11.glRotatef(var5, 1.0F, 0.0F, 0.0F);
037        GL11.glRotatef(var6, 0.0F, 1.0F, 0.0F);
038        GL11.glTranslatef(0.0F, -1.2F, 0.0F);
039    }
040
041    protected float handleRotationFloat(EntitySquid par1EntitySquid, float par2)
042    {
043        return par1EntitySquid.lastTentacleAngle + (par1EntitySquid.tentacleAngle - par1EntitySquid.lastTentacleAngle) * par2;
044    }
045
046    /**
047     * Defines what float the third param in setRotationAngles of ModelBase is
048     */
049    protected float handleRotationFloat(EntityLiving par1EntityLiving, float par2)
050    {
051        return this.handleRotationFloat((EntitySquid)par1EntityLiving, par2);
052    }
053
054    protected void rotateCorpse(EntityLiving par1EntityLiving, float par2, float par3, float par4)
055    {
056        this.rotateSquidsCorpse((EntitySquid)par1EntityLiving, par2, par3, par4);
057    }
058
059    public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
060    {
061        this.renderLivingSquid((EntitySquid)par1EntityLiving, par2, par4, par6, par8, par9);
062    }
063
064    /**
065     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
066     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
067     * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
068     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
069     */
070    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
071    {
072        this.renderLivingSquid((EntitySquid)par1Entity, par2, par4, par6, par8, par9);
073    }
074}