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 ModelEnderman extends ModelBiped
008    {
009        /** Is the enderman carrying a block? */
010        public boolean isCarrying = false;
011    
012        /** Is the enderman attacking an entity? */
013        public boolean isAttacking = false;
014    
015        public ModelEnderman()
016        {
017            super(0.0F, -14.0F);
018            float var1 = -14.0F;
019            float var2 = 0.0F;
020            this.bipedHeadwear = new ModelRenderer(this, 0, 16);
021            this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var2 - 0.5F);
022            this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + var1, 0.0F);
023            this.bipedBody = new ModelRenderer(this, 32, 16);
024            this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var2);
025            this.bipedBody.setRotationPoint(0.0F, 0.0F + var1, 0.0F);
026            this.bipedRightArm = new ModelRenderer(this, 56, 0);
027            this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, var2);
028            this.bipedRightArm.setRotationPoint(-3.0F, 2.0F + var1, 0.0F);
029            this.bipedLeftArm = new ModelRenderer(this, 56, 0);
030            this.bipedLeftArm.mirror = true;
031            this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, var2);
032            this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + var1, 0.0F);
033            this.bipedRightLeg = new ModelRenderer(this, 56, 0);
034            this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, var2);
035            this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + var1, 0.0F);
036            this.bipedLeftLeg = new ModelRenderer(this, 56, 0);
037            this.bipedLeftLeg.mirror = true;
038            this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, var2);
039            this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + var1, 0.0F);
040        }
041    
042        /**
043         * Sets the models various rotation angles.
044         */
045        public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6)
046        {
047            super.setRotationAngles(par1, par2, par3, par4, par5, par6);
048            this.bipedHead.showModel = true;
049            float var7 = -14.0F;
050            this.bipedBody.rotateAngleX = 0.0F;
051            this.bipedBody.rotationPointY = var7;
052            this.bipedBody.rotationPointZ = -0.0F;
053            this.bipedRightLeg.rotateAngleX -= 0.0F;
054            this.bipedLeftLeg.rotateAngleX -= 0.0F;
055            this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX * 0.5D);
056            this.bipedLeftArm.rotateAngleX = (float)((double)this.bipedLeftArm.rotateAngleX * 0.5D);
057            this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D);
058            this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D);
059            float var8 = 0.4F;
060    
061            if (this.bipedRightArm.rotateAngleX > var8)
062            {
063                this.bipedRightArm.rotateAngleX = var8;
064            }
065    
066            if (this.bipedLeftArm.rotateAngleX > var8)
067            {
068                this.bipedLeftArm.rotateAngleX = var8;
069            }
070    
071            if (this.bipedRightArm.rotateAngleX < -var8)
072            {
073                this.bipedRightArm.rotateAngleX = -var8;
074            }
075    
076            if (this.bipedLeftArm.rotateAngleX < -var8)
077            {
078                this.bipedLeftArm.rotateAngleX = -var8;
079            }
080    
081            if (this.bipedRightLeg.rotateAngleX > var8)
082            {
083                this.bipedRightLeg.rotateAngleX = var8;
084            }
085    
086            if (this.bipedLeftLeg.rotateAngleX > var8)
087            {
088                this.bipedLeftLeg.rotateAngleX = var8;
089            }
090    
091            if (this.bipedRightLeg.rotateAngleX < -var8)
092            {
093                this.bipedRightLeg.rotateAngleX = -var8;
094            }
095    
096            if (this.bipedLeftLeg.rotateAngleX < -var8)
097            {
098                this.bipedLeftLeg.rotateAngleX = -var8;
099            }
100    
101            if (this.isCarrying)
102            {
103                this.bipedRightArm.rotateAngleX = -0.5F;
104                this.bipedLeftArm.rotateAngleX = -0.5F;
105                this.bipedRightArm.rotateAngleZ = 0.05F;
106                this.bipedLeftArm.rotateAngleZ = -0.05F;
107            }
108    
109            this.bipedRightArm.rotationPointZ = 0.0F;
110            this.bipedLeftArm.rotationPointZ = 0.0F;
111            this.bipedRightLeg.rotationPointZ = 0.0F;
112            this.bipedLeftLeg.rotationPointZ = 0.0F;
113            this.bipedRightLeg.rotationPointY = 9.0F + var7;
114            this.bipedLeftLeg.rotationPointY = 9.0F + var7;
115            this.bipedHead.rotationPointZ = -0.0F;
116            this.bipedHead.rotationPointY = var7 + 1.0F;
117            this.bipedHeadwear.rotationPointX = this.bipedHead.rotationPointX;
118            this.bipedHeadwear.rotationPointY = this.bipedHead.rotationPointY;
119            this.bipedHeadwear.rotationPointZ = this.bipedHead.rotationPointZ;
120            this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX;
121            this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY;
122            this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ;
123    
124            if (this.isAttacking)
125            {
126                float var9 = 1.0F;
127                this.bipedHead.rotationPointY -= var9 * 5.0F;
128            }
129        }
130    }