    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.EntityChicken;
    009import net.minecraft.util.MathHelper;
    010
    011@SideOnly(Side.CLIENT)
    012public class RenderChicken extends RenderLiving
    013{
    014    public RenderChicken(ModelBase par1ModelBase, float par2)
    015    {
    016        super(par1ModelBase, par2);
    017    }
    018
    019    public void renderChicken(EntityChicken par1EntityChicken, double par2, double par4, double par6, float par8, float par9)
    020    {
    021        super.doRenderLiving(par1EntityChicken, par2, par4, par6, par8, par9);
    022    }
    023
    024    protected float getWingRotation(EntityChicken par1EntityChicken, float par2)
    025    {
    026        float f1 = par1EntityChicken.field_70888_h + (par1EntityChicken.field_70886_e - par1EntityChicken.field_70888_h) * par2;
    027        float f2 = par1EntityChicken.field_70884_g + (par1EntityChicken.destPos - par1EntityChicken.field_70884_g) * par2;
    028        return (MathHelper.sin(f1) + 1.0F) * f2;
    029    }
    030
    031    /**
    032     * Defines what float the third param in setRotationAngles of ModelBase is
    033     */
    034    protected float handleRotationFloat(EntityLiving par1EntityLiving, float par2)
    035    {
    036        return this.getWingRotation((EntityChicken)par1EntityLiving, par2);
    037    }
    038
    039    public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
    040    {
    041        this.renderChicken((EntityChicken)par1EntityLiving, par2, par4, par6, par8, par9);
    042    }
    043
    044    /**
    045     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
    046     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
    047     * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
    048     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
    049     */
    050    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    051    {
    052        this.renderChicken((EntityChicken)par1Entity, par2, par4, par6, par8, par9);
    053    }
    054}