From 2dc2642bc9b9300423bf449b27bce3b076ea5924 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 3 Jun 2018 16:59:32 +0200 Subject: [PATCH] Fixed more wonkyness and inconsistency between players and mobs --- .../minelittlepony/model/AbstractPonyModel.java | 17 ----------------- .../com/minelittlepony/model/ModelMobPony.java | 9 --------- .../model/player/ModelUnicorn.java | 9 ++++----- .../model/ponies/ModelSkeletonPony.java | 7 ------- .../model/ponies/ModelZombiePony.java | 16 ++++++---------- 5 files changed, 10 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java index f23f8fae..fd29a75b 100644 --- a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java +++ b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java @@ -18,7 +18,6 @@ import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.EnumHandSide; import net.minecraft.util.math.MathHelper; @@ -77,10 +76,6 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { rainboom = canFly() && Math.sqrt(entity.motionX * entity.motionX + entity.motionZ * entity.motionZ) > 0.4F; } - public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float partialTicks) { - - } - /** * Sets the model's various rotation angles. * @@ -143,8 +138,6 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { if (isSleeping) ponySleep(); - fixSpecialRotationPoints(move); - animateWears(); snout.setGender(metadata.getGender()); @@ -474,16 +467,6 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { AbstractPonyRenderer.shiftRotationPoint(bipedLeftLeg, 0, 2, -8); } - /** - * Called after postioning but before wears alignment to perform some last-minute adjustments. - * - * @param move Entity motion parameter. See {@link AbstractPonyModel.setRotationAngles}. - * - * TODO: Empty method - */ - protected void fixSpecialRotationPoints(float move) { - } - public void init(float yOffset, float stretch) { // TODO: Splitting things like this isn't strictly neccessary and just complicates things. initTextures(); diff --git a/src/main/java/com/minelittlepony/model/ModelMobPony.java b/src/main/java/com/minelittlepony/model/ModelMobPony.java index e7c95875..212cdd50 100644 --- a/src/main/java/com/minelittlepony/model/ModelMobPony.java +++ b/src/main/java/com/minelittlepony/model/ModelMobPony.java @@ -18,20 +18,12 @@ public class ModelMobPony extends ModelAlicorn { super(false); } - /** - * Returns true if the angle is to the right? - */ - public boolean islookAngleRight(float move) { - return MathHelper.sin(move / 20) < 0; - } - @Override protected void rotateLegs(float move, float swing, float ticks, Entity entity) { super.rotateLegs(move, swing, ticks, entity); if (rightArmPose != ArmPose.EMPTY) { if (canCast()) { - unicornArmRight.setRotationPoint(-7, 12, -2); rotateArmHolding(unicornArmRight, -1, swingProgress, ticks); } else { rotateArmHolding(bipedRightArm, -1, swingProgress, ticks); @@ -40,7 +32,6 @@ public class ModelMobPony extends ModelAlicorn { if (leftArmPose != ArmPose.EMPTY) { if (canCast()) { - unicornArmRight.setRotationPoint(-7, 12, -2); rotateArmHolding(unicornArmLeft, -1, swingProgress, ticks); } else { rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks); diff --git a/src/main/java/com/minelittlepony/model/player/ModelUnicorn.java b/src/main/java/com/minelittlepony/model/player/ModelUnicorn.java index 245ceeb0..d43576f8 100644 --- a/src/main/java/com/minelittlepony/model/player/ModelUnicorn.java +++ b/src/main/java/com/minelittlepony/model/player/ModelUnicorn.java @@ -2,6 +2,8 @@ package com.minelittlepony.model.player; import com.minelittlepony.model.components.UnicornHorn; import com.minelittlepony.render.PonyRenderer; + +import net.minecraft.client.model.ModelBiped.ArmPose; import net.minecraft.entity.Entity; import net.minecraft.util.EnumHandSide; import net.minecraft.util.math.MathHelper; @@ -49,11 +51,8 @@ public class ModelUnicorn extends ModelEarthPony implements IModelUnicorn { protected void rotateLegs(float move, float swing, float ticks, Entity entity) { super.rotateLegs(move, swing, ticks, entity); - unicornArmLeft.rotationPointX = 5; - unicornArmRight.rotationPointX = -5; - - unicornArmLeft.rotationPointY = unicornArmRight.rotationPointY = 8; - unicornArmLeft.rotationPointZ = unicornArmRight.rotationPointZ = 10; + unicornArmRight.setRotationPoint(-7, 12, -2); + unicornArmLeft.setRotationPoint(-7, 12, -2); unicornArmLeft.rotateAngleZ = 0; unicornArmRight.rotateAngleZ = 0; diff --git a/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java b/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java index 0bb5e861..5ec4f57c 100644 --- a/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java +++ b/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java @@ -33,13 +33,6 @@ public class ModelSkeletonPony extends ModelMobPony { super.setLivingAnimations(entity, move, swing, ticks); } - @Override - protected void fixSpecialRotationPoints(float move) { - if (rightArmPose != ArmPose.EMPTY && !canCast()) { - bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4); - } - } - protected float getLegOutset() { if (isSleeping) return 2.6f; if (isCrouching()) return 0; diff --git a/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java b/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java index 1cb51738..a23751cd 100644 --- a/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java +++ b/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java @@ -4,6 +4,7 @@ import com.minelittlepony.model.ModelMobPony; import com.minelittlepony.render.AbstractPonyRenderer; import net.minecraft.entity.Entity; +import net.minecraft.util.math.MathHelper; public class ModelZombiePony extends ModelMobPony { @Override @@ -13,19 +14,14 @@ public class ModelZombiePony extends ModelMobPony { if (islookAngleRight(move)) { rotateArmHolding(bipedRightArm, 1, swingProgress, ticks); - } else { - rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks); - } - } - - @Override - protected void fixSpecialRotationPoints(float move) { - if (rightArmPose != ArmPose.EMPTY) return; - - if (islookAngleRight(move)) { AbstractPonyRenderer.shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3); } else { + rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks); AbstractPonyRenderer.shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3); } } + + public boolean islookAngleRight(float move) { + return MathHelper.sin(move / 20) < 0; + } }