    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 ModelEnderCrystal extends ModelBase
    009    {
    010        /** The cube model for the Ender Crystal. */
    011        private ModelRenderer cube;
    012
    013        /** The glass model for the Ender Crystal. */
    014        private ModelRenderer glass = new ModelRenderer(this, "glass");
    015
    016        /** The base model for the Ender Crystal. */
    017        private ModelRenderer base;
    018
    019        public ModelEnderCrystal(float par1, boolean par2)
    020        {
    021            this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
    022            this.cube = new ModelRenderer(this, "cube");
    023            this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
    024
    025            if (par2)
    026            {
    027                this.base = new ModelRenderer(this, "base");
    028                this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12);
    029            }
    030        }
    031
    032        /**
    033         * Sets the models various rotation angles then renders the model.
    034         */
    035        public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
    036        {
    037            GL11.glPushMatrix();
    038            GL11.glScalef(2.0F, 2.0F, 2.0F);
    039            GL11.glTranslatef(0.0F, -0.5F, 0.0F);
    040
    041            if (this.base != null)
    042            {
    043                this.base.render(par7);
    044            }
    045
    046            GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    047            GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F);
    048            GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    049            this.glass.render(par7);
    050            float var8 = 0.875F;
    051            GL11.glScalef(var8, var8, var8);
    052            GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    053            GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    054            this.glass.render(par7);
    055            GL11.glScalef(var8, var8, var8);
    056            GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    057            GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    058            this.cube.render(par7);
    059            GL11.glPopMatrix();
    060        }
    061    }