2016-11-17 05:45:04 +01:00
|
|
|
package com.minelittlepony.model.pony;
|
2015-08-02 00:36:33 +02:00
|
|
|
|
2016-05-20 22:22:31 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2016-05-04 03:23:57 +02:00
|
|
|
import net.minecraft.util.math.MathHelper;
|
2015-08-02 00:36:33 +02:00
|
|
|
|
2015-12-16 05:29:47 +01:00
|
|
|
public class ModelZombiePony extends ModelPlayerPony {
|
2015-08-02 00:36:33 +02:00
|
|
|
|
2016-01-19 06:34:07 +01:00
|
|
|
public ModelZombiePony() {
|
|
|
|
super(false);
|
|
|
|
}
|
|
|
|
|
2015-08-02 00:36:33 +02:00
|
|
|
@Override
|
2016-05-20 22:22:31 +02:00
|
|
|
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
2015-08-02 00:36:33 +02:00
|
|
|
float rightArmRotateAngleX;
|
|
|
|
float leftArmRotateAngleX;
|
|
|
|
float rightLegRotateAngleX;
|
|
|
|
float leftLegRotateAngleX;
|
|
|
|
float var8;
|
|
|
|
float var9;
|
2015-12-15 06:32:57 +01:00
|
|
|
// why are zombies flying?
|
2016-05-20 22:22:31 +02:00
|
|
|
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) {
|
2015-08-02 00:36:33 +02:00
|
|
|
if (this.rainboom) {
|
|
|
|
rightArmRotateAngleX = ROTATE_270;
|
|
|
|
leftArmRotateAngleX = ROTATE_270;
|
|
|
|
rightLegRotateAngleX = ROTATE_90;
|
|
|
|
leftLegRotateAngleX = ROTATE_90;
|
|
|
|
} else {
|
|
|
|
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
|
|
|
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
|
|
|
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
|
|
|
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.bipedRightArm.rotateAngleY = 0.2F;
|
2016-01-19 06:34:07 +01:00
|
|
|
this.steveRightArm.rotateAngleY = 0.2F;
|
2015-08-02 00:36:33 +02:00
|
|
|
this.bipedLeftArm.rotateAngleY = -0.2F;
|
|
|
|
this.bipedRightLeg.rotateAngleY = -0.2F;
|
|
|
|
this.bipedLeftLeg.rotateAngleY = 0.2F;
|
|
|
|
} else {
|
|
|
|
var8 = (float) Math.pow(swing, 16.0D);
|
|
|
|
var9 = 3.1415927F * var8 * 0.5F;
|
|
|
|
float laQuad = 3.1415927F * var8;
|
|
|
|
float rlQuad = 3.1415927F * var8 * 0.2F;
|
|
|
|
float llQuad = 3.1415927F * var8 * -0.4F;
|
|
|
|
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + var9) * 0.45F * swing;
|
|
|
|
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing;
|
|
|
|
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing;
|
|
|
|
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing;
|
|
|
|
this.bipedRightArm.rotateAngleY = 0.0F;
|
2016-01-19 06:34:07 +01:00
|
|
|
this.steveRightArm.rotateAngleY = 0.0F;
|
2016-05-20 22:22:07 +02:00
|
|
|
this.unicornArmRight.rotateAngleY = 0.0F;
|
2015-08-02 00:36:33 +02:00
|
|
|
this.bipedLeftArm.rotateAngleY = 0.0F;
|
|
|
|
this.bipedRightLeg.rotateAngleY = 0.0F;
|
|
|
|
this.bipedLeftLeg.rotateAngleY = 0.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
|
2016-01-19 06:34:07 +01:00
|
|
|
this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
|
2016-05-20 22:22:07 +02:00
|
|
|
this.unicornArmRight.rotateAngleX = 0.0F;
|
2015-08-02 00:36:33 +02:00
|
|
|
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
|
|
|
|
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
|
|
|
|
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
|
|
|
|
this.bipedRightArm.rotateAngleZ = 0.0F;
|
2016-01-19 06:34:07 +01:00
|
|
|
this.steveRightArm.rotateAngleZ = 0.0F;
|
2016-05-20 22:22:07 +02:00
|
|
|
this.unicornArmRight.rotateAngleZ = 0.0F;
|
2015-08-02 00:36:33 +02:00
|
|
|
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
2016-05-04 03:23:57 +02:00
|
|
|
if (this.rightArmPose == ArmPose.EMPTY) {
|
2015-08-02 00:36:33 +02:00
|
|
|
var8 = MathHelper.sin(this.swingProgress * (float) Math.PI);
|
|
|
|
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float) Math.PI);
|
|
|
|
if (MathHelper.sin(move / 20.0F) < 0.0F) {
|
|
|
|
this.bipedRightArm.rotateAngleZ = 0.0F;
|
|
|
|
this.bipedRightArm.rotateAngleY = 0.1F - var8 * 0.6F;
|
|
|
|
this.bipedRightArm.rotateAngleX = -1.5707964F;
|
|
|
|
this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
|
|
this.bipedRightArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
|
|
this.bipedRightArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
|
|
} else {
|
|
|
|
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
|
|
|
this.bipedLeftArm.rotateAngleY = -(0.1F - var8 * 0.6F);
|
|
|
|
this.bipedLeftArm.rotateAngleX = -1.5707964F;
|
|
|
|
this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
|
|
this.bipedLeftArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
|
|
this.bipedLeftArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void fixSpecialRotationPoints(float move) {
|
2016-05-04 03:23:57 +02:00
|
|
|
if (this.rightArmPose == ArmPose.EMPTY) {
|
2015-08-02 00:36:33 +02:00
|
|
|
if (MathHelper.sin(move / 20.0F) < 0.0F) {
|
2016-03-01 05:42:22 +01:00
|
|
|
shiftRotationPoint(this.bipedRightArm, 0.5F, 1.5F, 3.0F);
|
2015-08-02 00:36:33 +02:00
|
|
|
} else {
|
2016-03-01 05:42:22 +01:00
|
|
|
shiftRotationPoint(this.bipedLeftArm, -0.5F, 1.5F, 3.0F);
|
2015-08-02 00:36:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|