| 1 | package net.minecraft.client.model;
|
| 2 |
|
| 3 | import net.minecraft.entity.Entity;
|
| 4 | import net.minecraft.util.MathHelper;
|
| 5 |
|
| 6 | public class ModelZombieVillager extends ModelBiped
|
| 7 | {
|
| 8 | public ModelZombieVillager()
|
| 9 | {
|
| 10 | this(0.0F, 0.0F, false);
|
| 11 | }
|
| 12 |
|
| 13 | public ModelZombieVillager(float p_i1165_1_, float p_i1165_2_, boolean p_i1165_3_)
|
| 14 | {
|
| 15 | super(p_i1165_1_, 0.0F, 64, p_i1165_3_ ? 32 : 64);
|
| 16 |
|
| 17 | if (p_i1165_3_)
|
| 18 | {
|
| 19 | this.bipedHead = new ModelRenderer(this, 0, 0);
|
| 20 | this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 8, 8, p_i1165_1_);
|
| 21 | this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F);
|
| 22 | }
|
| 23 | else
|
| 24 | {
|
| 25 | this.bipedHead = new ModelRenderer(this);
|
| 26 | this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F);
|
| 27 | this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1165_1_);
|
| 28 | this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, p_i1165_1_);
|
| 29 | }
|
| 30 | }
|
| 31 |
|
| 32 | /**
|
| 33 | * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
|
| 34 | * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
|
| 35 | * "far" arms and legs can swing at most.
|
| 36 | */
|
| 37 | public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
| 38 | {
|
| 39 | super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
| 40 | float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
|
| 41 | float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
|
| 42 | this.bipedRightArm.rotateAngleZ = 0.0F;
|
| 43 | this.bipedLeftArm.rotateAngleZ = 0.0F;
|
| 44 | this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
|
| 45 | this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
|
| 46 | this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F);
|
| 47 | this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F);
|
| 48 | this.bipedRightArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
|
| 49 | this.bipedLeftArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
|
| 50 | this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
| 51 | this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
| 52 | this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
| 53 | this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
| 54 | }
|
| 55 | }
|
| 56 |
|