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