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 RenderVillager extends RenderLiving 009 { 010 protected ModelVillager field_77056_a; 011 012 public RenderVillager() 013 { 014 super(new ModelVillager(0.0F), 0.5F); 015 this.field_77056_a = (ModelVillager)this.mainModel; 016 } 017 018 protected int func_77053_a(EntityVillager par1EntityVillager, int par2, float par3) 019 { 020 return -1; 021 } 022 023 public void renderVillager(EntityVillager par1EntityVillager, double par2, double par4, double par6, float par8, float par9) 024 { 025 super.doRenderLiving(par1EntityVillager, par2, par4, par6, par8, par9); 026 } 027 028 protected void func_77055_a(EntityVillager par1EntityVillager, double par2, double par4, double par6) {} 029 030 protected void func_77051_a(EntityVillager par1EntityVillager, float par2) 031 { 032 super.renderEquippedItems(par1EntityVillager, par2); 033 } 034 035 protected void func_77052_b(EntityVillager par1EntityVillager, float par2) 036 { 037 float var3 = 0.9375F; 038 039 if (par1EntityVillager.getGrowingAge() < 0) 040 { 041 var3 = (float)((double)var3 * 0.5D); 042 this.shadowSize = 0.25F; 043 } 044 else 045 { 046 this.shadowSize = 0.5F; 047 } 048 049 GL11.glScalef(var3, var3, var3); 050 } 051 052 /** 053 * Passes the specialRender and renders it 054 */ 055 protected void passSpecialRender(EntityLiving par1EntityLiving, double par2, double par4, double par6) 056 { 057 this.func_77055_a((EntityVillager)par1EntityLiving, par2, par4, par6); 058 } 059 060 /** 061 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: 062 * entityLiving, partialTickTime 063 */ 064 protected void preRenderCallback(EntityLiving par1EntityLiving, float par2) 065 { 066 this.func_77052_b((EntityVillager)par1EntityLiving, par2); 067 } 068 069 /** 070 * Queries whether should render the specified pass or not. 071 */ 072 protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) 073 { 074 return this.func_77053_a((EntityVillager)par1EntityLiving, par2, par3); 075 } 076 077 protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2) 078 { 079 this.func_77051_a((EntityVillager)par1EntityLiving, par2); 080 } 081 082 public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) 083 { 084 this.renderVillager((EntityVillager)par1EntityLiving, par2, par4, par6, par8, par9); 085 } 086 087 /** 088 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then 089 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic 090 * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1, 091 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. 092 */ 093 public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) 094 { 095 this.renderVillager((EntityVillager)par1Entity, par2, par4, par6, par8, par9); 096 } 097 }