2018-04-25 16:40:47 +02:00
|
|
|
package com.minelittlepony.model;
|
|
|
|
|
|
|
|
import com.minelittlepony.model.ponies.ModelPlayerPony;
|
|
|
|
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Common class for all humanoid (ponioid?) non-player enemies.
|
|
|
|
*
|
|
|
|
*/
|
2018-04-25 16:40:47 +02:00
|
|
|
public class ModelMobPony extends ModelPlayerPony {
|
|
|
|
|
|
|
|
public ModelMobPony() {
|
|
|
|
super(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
|
|
|
super.rotateLegs(move, swing, tick, entity);
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
rotateRightArm(move, tick);
|
|
|
|
rotateLeftArm(move, tick);
|
2018-04-25 16:40:47 +02:00
|
|
|
}
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Called to update the left arm's final rotation.
|
|
|
|
* Subclasses may replace it with their own implementations.
|
2018-04-27 13:49:33 +02:00
|
|
|
*
|
2018-04-25 21:29:49 +02:00
|
|
|
* @param move Limb swing amount.
|
|
|
|
* @param tick Render partial ticks.
|
|
|
|
*/
|
|
|
|
protected void rotateRightArm(float move, float tick) {
|
2018-04-27 13:49:33 +02:00
|
|
|
if (rightArmPose == ArmPose.EMPTY) return;
|
|
|
|
|
2018-04-25 16:40:47 +02:00
|
|
|
if (!metadata.hasMagic()) {
|
2018-04-26 16:01:31 +02:00
|
|
|
rotateArmHolding(bipedRightArm, -1, swingProgress, tick);
|
2018-04-25 16:40:47 +02:00
|
|
|
} else {
|
|
|
|
unicornArmRight.setRotationPoint(-7, 12, -2);
|
2018-04-26 16:01:31 +02:00
|
|
|
rotateArmHolding(unicornArmRight, -1, swingProgress, tick);
|
2018-04-25 16:40:47 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Same as rotateRightArm but for the left arm (duh).
|
2018-04-27 13:49:33 +02:00
|
|
|
*
|
2018-04-25 21:29:49 +02:00
|
|
|
* @param move Limb swing amount.
|
|
|
|
* @param tick Render partial ticks.
|
|
|
|
*/
|
|
|
|
protected void rotateLeftArm(float move, float tick) {
|
2018-04-25 16:40:47 +02:00
|
|
|
if (leftArmPose == ArmPose.EMPTY) return;
|
|
|
|
|
|
|
|
if (!metadata.hasMagic()) {
|
2018-04-26 16:01:31 +02:00
|
|
|
rotateArmHolding(bipedLeftArm, -1, swingProgress, tick);
|
2018-04-25 16:40:47 +02:00
|
|
|
} else {
|
|
|
|
unicornArmRight.setRotationPoint(-7, 12, -2);
|
2018-04-26 16:01:31 +02:00
|
|
|
rotateArmHolding(unicornArmLeft, -1, swingProgress, tick);
|
2018-04-25 16:40:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|