001 package net.minecraft.src; 002 003 import cpw.mods.fml.common.Side; 004 import cpw.mods.fml.common.asm.SideOnly; 005 import org.lwjgl.opengl.GL11; 006 007 @SideOnly(Side.CLIENT) 008 public class RenderSheep extends RenderLiving 009 { 010 public RenderSheep(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) 011 { 012 super(par1ModelBase, par3); 013 this.setRenderPassModel(par2ModelBase); 014 } 015 016 protected int setWoolColorAndRender(EntitySheep par1EntitySheep, int par2, float par3) 017 { 018 if (par2 == 0 && !par1EntitySheep.getSheared()) 019 { 020 this.loadTexture("/mob/sheep_fur.png"); 021 float var4 = 1.0F; 022 int var5 = par1EntitySheep.getFleeceColor(); 023 GL11.glColor3f(var4 * EntitySheep.fleeceColorTable[var5][0], var4 * EntitySheep.fleeceColorTable[var5][1], var4 * EntitySheep.fleeceColorTable[var5][2]); 024 return 1; 025 } 026 else 027 { 028 return -1; 029 } 030 } 031 032 public void doRenderSheep(EntitySheep par1EntitySheep, double par2, double par4, double par6, float par8, float par9) 033 { 034 super.doRenderLiving(par1EntitySheep, 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.setWoolColorAndRender((EntitySheep)par1EntityLiving, par2, par3); 043 } 044 045 public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) 046 { 047 this.doRenderSheep((EntitySheep)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.doRenderSheep((EntitySheep)par1Entity, par2, par4, par6, par8, par9); 059 } 060 }