| 1 | package net.minecraft.client.model;
|
| 2 |
|
| 3 | import net.minecraft.entity.Entity;
|
| 4 |
|
| 5 | public class ModelEnderman extends ModelBiped
|
| 6 | {
|
| 7 | /** Is the enderman carrying a block? */
|
| 8 | public boolean isCarrying;
|
| 9 |
|
| 10 | /** Is the enderman attacking an entity? */
|
| 11 | public boolean isAttacking;
|
| 12 |
|
| 13 | public ModelEnderman(float p_i46305_1_)
|
| 14 | {
|
| 15 | super(0.0F, -14.0F, 64, 32);
|
| 16 | float f = -14.0F;
|
| 17 | this.bipedHeadwear = new ModelRenderer(this, 0, 16);
|
| 18 | this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46305_1_ - 0.5F);
|
| 19 | this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + f, 0.0F);
|
| 20 | this.bipedBody = new ModelRenderer(this, 32, 16);
|
| 21 | this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46305_1_);
|
| 22 | this.bipedBody.setRotationPoint(0.0F, 0.0F + f, 0.0F);
|
| 23 | this.bipedRightArm = new ModelRenderer(this, 56, 0);
|
| 24 | this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, p_i46305_1_);
|
| 25 | this.bipedRightArm.setRotationPoint(-3.0F, 2.0F + f, 0.0F);
|
| 26 | this.bipedLeftArm = new ModelRenderer(this, 56, 0);
|
| 27 | this.bipedLeftArm.mirror = true;
|
| 28 | this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, p_i46305_1_);
|
| 29 | this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + f, 0.0F);
|
| 30 | this.bipedRightLeg = new ModelRenderer(this, 56, 0);
|
| 31 | this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, p_i46305_1_);
|
| 32 | this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + f, 0.0F);
|
| 33 | this.bipedLeftLeg = new ModelRenderer(this, 56, 0);
|
| 34 | this.bipedLeftLeg.mirror = true;
|
| 35 | this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, p_i46305_1_);
|
| 36 | this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + f, 0.0F);
|
| 37 | }
|
| 38 |
|
| 39 | /**
|
| 40 | * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
|
| 41 | * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
|
| 42 | * "far" arms and legs can swing at most.
|
| 43 | */
|
| 44 | public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
| 45 | {
|
| 46 | super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
| 47 | this.bipedHead.showModel = true;
|
| 48 | float f = -14.0F;
|
| 49 | this.bipedBody.rotateAngleX = 0.0F;
|
| 50 | this.bipedBody.rotationPointY = f;
|
| 51 | this.bipedBody.rotationPointZ = -0.0F;
|
| 52 | this.bipedRightLeg.rotateAngleX -= 0.0F;
|
| 53 | this.bipedLeftLeg.rotateAngleX -= 0.0F;
|
| 54 | this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX * 0.5D);
|
| 55 | this.bipedLeftArm.rotateAngleX = (float)((double)this.bipedLeftArm.rotateAngleX * 0.5D);
|
| 56 | this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D);
|
| 57 | this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D);
|
| 58 | float f1 = 0.4F;
|
| 59 |
|
| 60 | if (this.bipedRightArm.rotateAngleX > f1)
|
| 61 | {
|
| 62 | this.bipedRightArm.rotateAngleX = f1;
|
| 63 | }
|
| 64 |
|
| 65 | if (this.bipedLeftArm.rotateAngleX > f1)
|
| 66 | {
|
| 67 | this.bipedLeftArm.rotateAngleX = f1;
|
| 68 | }
|
| 69 |
|
| 70 | if (this.bipedRightArm.rotateAngleX < -f1)
|
| 71 | {
|
| 72 | this.bipedRightArm.rotateAngleX = -f1;
|
| 73 | }
|
| 74 |
|
| 75 | if (this.bipedLeftArm.rotateAngleX < -f1)
|
| 76 | {
|
| 77 | this.bipedLeftArm.rotateAngleX = -f1;
|
| 78 | }
|
| 79 |
|
| 80 | if (this.bipedRightLeg.rotateAngleX > f1)
|
| 81 | {
|
| 82 | this.bipedRightLeg.rotateAngleX = f1;
|
| 83 | }
|
| 84 |
|
| 85 | if (this.bipedLeftLeg.rotateAngleX > f1)
|
| 86 | {
|
| 87 | this.bipedLeftLeg.rotateAngleX = f1;
|
| 88 | }
|
| 89 |
|
| 90 | if (this.bipedRightLeg.rotateAngleX < -f1)
|
| 91 | {
|
| 92 | this.bipedRightLeg.rotateAngleX = -f1;
|
| 93 | }
|
| 94 |
|
| 95 | if (this.bipedLeftLeg.rotateAngleX < -f1)
|
| 96 | {
|
| 97 | this.bipedLeftLeg.rotateAngleX = -f1;
|
| 98 | }
|
| 99 |
|
| 100 | if (this.isCarrying)
|
| 101 | {
|
| 102 | this.bipedRightArm.rotateAngleX = -0.5F;
|
| 103 | this.bipedLeftArm.rotateAngleX = -0.5F;
|
| 104 | this.bipedRightArm.rotateAngleZ = 0.05F;
|
| 105 | this.bipedLeftArm.rotateAngleZ = -0.05F;
|
| 106 | }
|
| 107 |
|
| 108 | this.bipedRightArm.rotationPointZ = 0.0F;
|
| 109 | this.bipedLeftArm.rotationPointZ = 0.0F;
|
| 110 | this.bipedRightLeg.rotationPointZ = 0.0F;
|
| 111 | this.bipedLeftLeg.rotationPointZ = 0.0F;
|
| 112 | this.bipedRightLeg.rotationPointY = 9.0F + f;
|
| 113 | this.bipedLeftLeg.rotationPointY = 9.0F + f;
|
| 114 | this.bipedHead.rotationPointZ = -0.0F;
|
| 115 | this.bipedHead.rotationPointY = f + 1.0F;
|
| 116 | this.bipedHeadwear.rotationPointX = this.bipedHead.rotationPointX;
|
| 117 | this.bipedHeadwear.rotationPointY = this.bipedHead.rotationPointY;
|
| 118 | this.bipedHeadwear.rotationPointZ = this.bipedHead.rotationPointZ;
|
| 119 | this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX;
|
| 120 | this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY;
|
| 121 | this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ;
|
| 122 |
|
| 123 | if (this.isAttacking)
|
| 124 | {
|
| 125 | float f2 = 1.0F;
|
| 126 | this.bipedHead.rotationPointY -= f2 * 5.0F;
|
| 127 | }
|
| 128 | }
|
| 129 | }
|
| 130 |
|