2018-04-25 16:40:47 +02:00
|
|
|
package com.minelittlepony.model;
|
|
|
|
|
2018-04-28 16:39:32 +02:00
|
|
|
import com.minelittlepony.model.player.ModelAlicorn;
|
2018-04-25 16:40:47 +02:00
|
|
|
|
2018-04-28 16:39:32 +02:00
|
|
|
import net.minecraft.util.math.MathHelper;
|
2018-04-25 16:40:47 +02:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Common class for all humanoid (ponioid?) non-player enemies.
|
|
|
|
*
|
|
|
|
*/
|
2018-04-28 16:39:32 +02:00
|
|
|
public class ModelMobPony extends ModelAlicorn {
|
2018-04-25 16:40:47 +02:00
|
|
|
|
|
|
|
public ModelMobPony() {
|
|
|
|
super(false);
|
|
|
|
}
|
|
|
|
|
2018-04-28 16:39:32 +02:00
|
|
|
/**
|
|
|
|
* Returns true if the angle is to the right?
|
|
|
|
*/
|
|
|
|
public boolean islookAngleRight(float move) {
|
|
|
|
return MathHelper.sin(move / 20f) < 0;
|
|
|
|
}
|
|
|
|
|
2018-04-29 14:22:26 +02:00
|
|
|
@Override
|
|
|
|
protected void adjustLegs(float move, float swing, float tick) {
|
|
|
|
super.adjustLegs(move, swing, tick);
|
|
|
|
if (rightArmPose != ArmPose.EMPTY) {
|
|
|
|
if (canCast()) {
|
|
|
|
unicornArmRight.setRotationPoint(-7, 12, -2);
|
|
|
|
rotateArmHolding(unicornArmRight, -1, swingProgress, tick);
|
|
|
|
} else {
|
|
|
|
rotateArmHolding(bipedRightArm, -1, swingProgress, tick);
|
|
|
|
}
|
2018-04-25 16:40:47 +02:00
|
|
|
}
|
|
|
|
|
2018-04-29 14:22:26 +02:00
|
|
|
if (leftArmPose != ArmPose.EMPTY) {
|
|
|
|
if (!canCast()) {
|
|
|
|
unicornArmRight.setRotationPoint(-7, 12, -2);
|
|
|
|
rotateArmHolding(unicornArmLeft, -1, swingProgress, tick);
|
|
|
|
} else {
|
|
|
|
rotateArmHolding(bipedLeftArm, -1, swingProgress, tick);
|
|
|
|
}
|
2018-04-25 16:40:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|