001 package net.minecraft.client.renderer.entity; 002 003 import cpw.mods.fml.relauncher.Side; 004 import cpw.mods.fml.relauncher.SideOnly; 005 import net.minecraft.client.model.ModelBase; 006 import net.minecraft.entity.Entity; 007 import net.minecraft.entity.EntityLiving; 008 import net.minecraft.entity.passive.EntityPig; 009 010 @SideOnly(Side.CLIENT) 011 public 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 this.loadTexture("/mob/saddle.png"); 022 return par2 == 0 && par1EntityPig.getSaddled() ? 1 : -1; 023 } 024 025 public void renderLivingPig(EntityPig par1EntityPig, double par2, double par4, double par6, float par8, float par9) 026 { 027 super.doRenderLiving(par1EntityPig, par2, par4, par6, par8, par9); 028 } 029 030 /** 031 * Queries whether should render the specified pass or not. 032 */ 033 protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) 034 { 035 return this.renderSaddledPig((EntityPig)par1EntityLiving, par2, par3); 036 } 037 038 public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) 039 { 040 this.renderLivingPig((EntityPig)par1EntityLiving, par2, par4, par6, par8, par9); 041 } 042 043 /** 044 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then 045 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic 046 * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1, 047 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. 048 */ 049 public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) 050 { 051 this.renderLivingPig((EntityPig)par1Entity, par2, par4, par6, par8, par9); 052 } 053 }