    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005
    006    @SideOnly(Side.CLIENT)
    007    public class RenderZombie extends RenderBiped
    008    {
    009        private ModelBiped field_82434_o;
    010        private ModelZombieVillager field_82432_p;
    011        protected ModelBiped field_82437_k;
    012        protected ModelBiped field_82435_l;
    013        protected ModelBiped field_82436_m;
    014        protected ModelBiped field_82433_n;
    015        private int field_82431_q = 1;
    016
    017        public RenderZombie()
    018        {
    019            super(new ModelZombie(), 0.5F, 1.0F);
    020            this.field_82434_o = this.modelBipedMain;
    021            this.field_82432_p = new ModelZombieVillager();
    022        }
    023
    024        protected void func_82421_b()
    025        {
    026            this.field_82423_g = new ModelZombie(1.0F, true);
    027            this.field_82425_h = new ModelZombie(0.5F, true);
    028            this.field_82437_k = this.field_82423_g;
    029            this.field_82435_l = this.field_82425_h;
    030            this.field_82436_m = new ModelZombieVillager(1.0F, 0.0F, true);
    031            this.field_82433_n = new ModelZombieVillager(0.5F, 0.0F, true);
    032        }
    033
    034        protected int func_82429_a(EntityZombie par1EntityZombie, int par2, float par3)
    035        {
    036            this.func_82427_a(par1EntityZombie);
    037            return super.shouldRenderPass(par1EntityZombie, par2, par3);
    038        }
    039
    040        public void func_82426_a(EntityZombie par1EntityZombie, double par2, double par4, double par6, float par8, float par9)
    041        {
    042            this.func_82427_a(par1EntityZombie);
    043            super.doRenderLiving(par1EntityZombie, par2, par4, par6, par8, par9);
    044        }
    045
    046        protected void func_82428_a(EntityZombie par1EntityZombie, float par2)
    047        {
    048            this.func_82427_a(par1EntityZombie);
    049            super.renderEquippedItems(par1EntityZombie, par2);
    050        }
    051
    052        private void func_82427_a(EntityZombie par1EntityZombie)
    053        {
    054            if (par1EntityZombie.func_82231_m())
    055            {
    056                if (this.field_82431_q != this.field_82432_p.func_82897_a())
    057                {
    058                    this.field_82432_p = new ModelZombieVillager();
    059                    this.field_82431_q = this.field_82432_p.func_82897_a();
    060                    this.field_82436_m = new ModelZombieVillager(1.0F, 0.0F, true);
    061                    this.field_82433_n = new ModelZombieVillager(0.5F, 0.0F, true);
    062                }
    063
    064                this.mainModel = this.field_82432_p;
    065                this.field_82423_g = this.field_82436_m;
    066                this.field_82425_h = this.field_82433_n;
    067            }
    068            else
    069            {
    070                this.mainModel = this.field_82434_o;
    071                this.field_82423_g = this.field_82437_k;
    072                this.field_82425_h = this.field_82435_l;
    073            }
    074
    075            this.modelBipedMain = (ModelBiped)this.mainModel;
    076        }
    077
    078        protected void func_82430_a(EntityZombie par1EntityZombie, float par2, float par3, float par4)
    079        {
    080            if (par1EntityZombie.func_82230_o())
    081            {
    082                par3 += (float)(Math.cos((double)par1EntityZombie.ticksExisted * 3.25D) * Math.PI * 0.25D);
    083            }
    084
    085            super.rotateCorpse(par1EntityZombie, par2, par3, par4);
    086        }
    087
    088        protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2)
    089        {
    090            this.func_82428_a((EntityZombie)par1EntityLiving, par2);
    091        }
    092
    093        public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
    094        {
    095            this.func_82426_a((EntityZombie)par1EntityLiving, par2, par4, par6, par8, par9);
    096        }
    097
    098        /**
    099         * Queries whether should render the specified pass or not.
    100         */
    101        protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3)
    102        {
    103            return this.func_82429_a((EntityZombie)par1EntityLiving, par2, par3);
    104        }
    105
    106        protected void rotateCorpse(EntityLiving par1EntityLiving, float par2, float par3, float par4)
    107        {
    108            this.func_82430_a((EntityZombie)par1EntityLiving, par2, par3, par4);
    109        }
    110
    111        /**
    112         * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
    113         * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
    114         * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
    115         * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
    116         */
    117        public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    118        {
    119            this.func_82426_a((EntityZombie)par1Entity, par2, par4, par6, par8, par9);
    120        }
    121    }