    001    package net.minecraft.client.model;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import net.minecraft.entity.Entity;
    006    import org.lwjgl.opengl.GL11;
    007
    008    @SideOnly(Side.CLIENT)
    009    public class ModelEnderCrystal extends ModelBase
    010    {
    011        /** The cube model for the Ender Crystal. */
    012        private ModelRenderer cube;
    013
    014        /** The glass model for the Ender Crystal. */
    015        private ModelRenderer glass = new ModelRenderer(this, "glass");
    016
    017        /** The base model for the Ender Crystal. */
    018        private ModelRenderer base;
    019
    020        public ModelEnderCrystal(float par1, boolean par2)
    021        {
    022            this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
    023            this.cube = new ModelRenderer(this, "cube");
    024            this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
    025
    026            if (par2)
    027            {
    028                this.base = new ModelRenderer(this, "base");
    029                this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12);
    030            }
    031        }
    032
    033        /**
    034         * Sets the models various rotation angles then renders the model.
    035         */
    036        public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
    037        {
    038            GL11.glPushMatrix();
    039            GL11.glScalef(2.0F, 2.0F, 2.0F);
    040            GL11.glTranslatef(0.0F, -0.5F, 0.0F);
    041
    042            if (this.base != null)
    043            {
    044                this.base.render(par7);
    045            }
    046
    047            GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    048            GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F);
    049            GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    050            this.glass.render(par7);
    051            float var8 = 0.875F;
    052            GL11.glScalef(var8, var8, var8);
    053            GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    054            GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    055            this.glass.render(par7);
    056            GL11.glScalef(var8, var8, var8);
    057            GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    058            GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    059            this.cube.render(par7);
    060            GL11.glPopMatrix();
    061        }
    062    }