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.block.Block;
006    import net.minecraft.client.model.ModelBase;
007    import net.minecraft.client.model.ModelQuadruped;
008    import net.minecraft.entity.Entity;
009    import net.minecraft.entity.EntityLiving;
010    import net.minecraft.entity.passive.EntityMooshroom;
011    import org.lwjgl.opengl.GL11;
012    
013    @SideOnly(Side.CLIENT)
014    public class RenderMooshroom extends RenderLiving
015    {
016        public RenderMooshroom(ModelBase par1ModelBase, float par2)
017        {
018            super(par1ModelBase, par2);
019        }
020    
021        public void renderLivingMooshroom(EntityMooshroom par1EntityMooshroom, double par2, double par4, double par6, float par8, float par9)
022        {
023            super.doRenderLiving(par1EntityMooshroom, par2, par4, par6, par8, par9);
024        }
025    
026        protected void renderMooshroomEquippedItems(EntityMooshroom par1EntityMooshroom, float par2)
027        {
028            super.renderEquippedItems(par1EntityMooshroom, par2);
029    
030            if (!par1EntityMooshroom.isChild())
031            {
032                this.loadTexture("/terrain.png");
033                GL11.glEnable(GL11.GL_CULL_FACE);
034                GL11.glPushMatrix();
035                GL11.glScalef(1.0F, -1.0F, 1.0F);
036                GL11.glTranslatef(0.2F, 0.4F, 0.5F);
037                GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
038                this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
039                GL11.glTranslatef(0.1F, 0.0F, -0.6F);
040                GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
041                this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
042                GL11.glPopMatrix();
043                GL11.glPushMatrix();
044                ((ModelQuadruped)this.mainModel).head.postRender(0.0625F);
045                GL11.glScalef(1.0F, -1.0F, 1.0F);
046                GL11.glTranslatef(0.0F, 0.75F, -0.2F);
047                GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
048                this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
049                GL11.glPopMatrix();
050                GL11.glDisable(GL11.GL_CULL_FACE);
051            }
052        }
053    
054        protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2)
055        {
056            this.renderMooshroomEquippedItems((EntityMooshroom)par1EntityLiving, par2);
057        }
058    
059        public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
060        {
061            this.renderLivingMooshroom((EntityMooshroom)par1EntityLiving, par2, par4, par6, par8, par9);
062        }
063    
064        /**
065         * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
066         * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
067         * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
068         * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
069         */
070        public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
071        {
072            this.renderLivingMooshroom((EntityMooshroom)par1Entity, par2, par4, par6, par8, par9);
073        }
074    }