From 028b86d749dedcff614f38f0418000a915a557da Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 27 Jul 2018 00:10:35 +0200 Subject: [PATCH] Fix derped swimming animation --- .../minelittlepony/model/AbstractPonyModel.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java index 2a0c7f51..4fbffa6e 100644 --- a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java +++ b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java @@ -72,7 +72,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { * Checks flying and speed conditions and sets rainboom to true if we're a species with wings and is going faaast. */ protected void checkRainboom(Entity entity, float swing) { - rainboom = isSwimming() || canFly() && Math.sqrt(entity.motionX * entity.motionX + entity.motionZ * entity.motionZ) > 0.4F; + rainboom = canFly() && Math.sqrt(entity.motionX * entity.motionX + entity.motionZ * entity.motionZ) > 0.4F; } public void updateLivingState(EntityLivingBase entity, Pony pony) { @@ -112,7 +112,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { shakeBody(move, swing, getWobbleAmount(), ticks); rotateLegs(move, swing, ticks, entity); - if (!rainboom) { + if (!isSwimming && !rainboom) { holdItem(swing); } swingItem(entity); @@ -175,7 +175,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { * @param ticks Total whole and partial ticks since the entity's existance. Used in animations together with {@code swing} and {@code move}. */ protected void shakeBody(float move, float swing, float bodySwing, float ticks) { - tail.setRotationAndAngles(rainboom, move, swing, bodySwing * 5, ticks); + tail.setRotationAndAngles(isSwimming || rainboom, move, swing, bodySwing * 5, ticks); upperTorso.rotateAngleY = bodySwing; bipedBody.rotateAngleY = bodySwing; @@ -276,24 +276,19 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { float leftY = -forward - MathHelper.sin((move / 3) + 2*PI/3); float rightX = down + MathHelper.sin(move / 3) / 2; - float rightY = forward + MathHelper.sin(move / 3); bipedLeftArm.rotateAngleX = leftX; bipedLeftArm.rotateAngleY = leftY; - bipedRightArm.rotateAngleY = rightY; - bipedRightArm.rotateAngleX = rightX; - - + bipedRightArm.rotateAngleY = -leftY; + bipedRightArm.rotateAngleX = leftX; bipedLeftLeg.rotateAngleX = leftX; bipedRightLeg.rotateAngleX = rightX; bipedLeftLeg.rotateAngleY = 0; bipedRightLeg.rotateAngleY = 0; - - } /**