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.EntityPig;
009
010@SideOnly(Side.CLIENT)
011public class RenderPig extends RenderLiving
012{
013    public RenderPig(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3)
014    {
015        super(par1ModelBase, par3);
016        this.setRenderPassModel(par2ModelBase);
017    }
018
019    protected int renderSaddledPig(EntityPig par1EntityPig, int par2, float par3)
020    {
021        if (par2 == 0 && par1EntityPig.getSaddled())
022        {
023            this.loadTexture("/mob/saddle.png");
024            return 1;
025        }
026        else
027        {
028            return -1;
029        }
030    }
031
032    public void renderLivingPig(EntityPig par1EntityPig, double par2, double par4, double par6, float par8, float par9)
033    {
034        super.doRenderLiving(par1EntityPig, par2, par4, par6, par8, par9);
035    }
036
037    /**
038     * Queries whether should render the specified pass or not.
039     */
040    protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3)
041    {
042        return this.renderSaddledPig((EntityPig)par1EntityLiving, par2, par3);
043    }
044
045    public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
046    {
047        this.renderLivingPig((EntityPig)par1EntityLiving, par2, par4, par6, par8, par9);
048    }
049
050    /**
051     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
052     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
053     * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
054     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
055     */
056    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
057    {
058        this.renderLivingPig((EntityPig)par1Entity, par2, par4, par6, par8, par9);
059    }
060}