mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fixed swinging animation not playing for horny ponies
This commit is contained in:
parent
12600fff3d
commit
7f6a01cf9d
3 changed files with 20 additions and 16 deletions
|
@ -101,12 +101,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
||||||
|
|
||||||
updateHeadRotation(headRotateAngleX, headRotateAngleY);
|
updateHeadRotation(headRotateAngleX, headRotateAngleY);
|
||||||
|
|
||||||
float bodySwingRotation = 0;
|
rotateLook(move, swing, getWobbleAmount(), ticks);
|
||||||
if (swingProgress > -9990.0F && !metadata.hasMagic()) {
|
|
||||||
bodySwingRotation = MathHelper.sin(MathHelper.sqrt(swingProgress) * PI * 2) * 0.2F;
|
|
||||||
}
|
|
||||||
|
|
||||||
rotateLook(move, swing, bodySwingRotation, ticks);
|
|
||||||
|
|
||||||
setLegs(move, swing, ticks, entity);
|
setLegs(move, swing, ticks, entity);
|
||||||
if (!rainboom) {
|
if (!rainboom) {
|
||||||
|
@ -151,6 +146,13 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
||||||
snout.setGender(metadata.getGender());
|
snout.setGender(metadata.getGender());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected float getWobbleAmount() {
|
||||||
|
if (swingProgress <= -9990.0F) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return MathHelper.sin(MathHelper.sqrt(swingProgress) * PI * 2) * 0.2F;
|
||||||
|
}
|
||||||
|
|
||||||
protected void adjustBodyRiding() {
|
protected void adjustBodyRiding() {
|
||||||
adjustBodyComponents(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
|
adjustBodyComponents(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
|
||||||
adjustNeck(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK);
|
adjustNeck(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK);
|
||||||
|
|
|
@ -38,6 +38,13 @@ public class ModelUnicorn extends ModelEarthPony implements IModelUnicorn {
|
||||||
unicornArmLeft.rotateAngleY = 0;
|
unicornArmLeft.rotateAngleY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected float getWobbleAmount() {
|
||||||
|
if (isCasting()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return super.getWobbleAmount();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void adjustLegs(float move, float swing, float ticks) {
|
protected void adjustLegs(float move, float swing, float ticks) {
|
||||||
super.adjustLegs(move, swing, ticks);
|
super.adjustLegs(move, swing, ticks);
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.minelittlepony.model.ponies;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.monster.EntityZombieVillager;
|
import net.minecraft.entity.monster.EntityZombieVillager;
|
||||||
import net.minecraft.entity.passive.EntityVillager;
|
import net.minecraft.entity.passive.EntityVillager;
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
import com.minelittlepony.model.player.ModelAlicorn;
|
import com.minelittlepony.model.player.ModelAlicorn;
|
||||||
|
@ -18,16 +17,12 @@ public class ModelVillagerPony extends ModelAlicorn {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
protected void rotateLook(float move, float swing, float bodySwing, float ticks) {
|
||||||
super.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);
|
super.rotateLook(move, swing, bodySwing, ticks);
|
||||||
|
|
||||||
float angleY = 0;
|
bag.rotateAngleY = bodySwing;
|
||||||
if (swingProgress > -9990.0F && !canCast()) {
|
apron.rotateAngleY = bodySwing;
|
||||||
angleY = MathHelper.sin(MathHelper.sqrt(swingProgress) * PI * 2) * 0.04F;
|
trinket.rotateAngleY = bodySwing;
|
||||||
}
|
|
||||||
bag.rotateAngleY = angleY;
|
|
||||||
apron.rotateAngleY = angleY;
|
|
||||||
trinket.rotateAngleY = angleY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue