mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-23 04:57:58 +01:00
Fixed more wonkyness and inconsistency between players and mobs
This commit is contained in:
parent
a5d67a7e1c
commit
2dc2642bc9
5 changed files with 10 additions and 48 deletions
|
@ -18,7 +18,6 @@ import net.minecraft.client.model.ModelPlayer;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.util.EnumHandSide;
|
import net.minecraft.util.EnumHandSide;
|
||||||
import net.minecraft.util.math.MathHelper;
|
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;
|
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.
|
* Sets the model's various rotation angles.
|
||||||
*
|
*
|
||||||
|
@ -143,8 +138,6 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
||||||
|
|
||||||
if (isSleeping) ponySleep();
|
if (isSleeping) ponySleep();
|
||||||
|
|
||||||
fixSpecialRotationPoints(move);
|
|
||||||
|
|
||||||
animateWears();
|
animateWears();
|
||||||
|
|
||||||
snout.setGender(metadata.getGender());
|
snout.setGender(metadata.getGender());
|
||||||
|
@ -474,16 +467,6 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
||||||
AbstractPonyRenderer.shiftRotationPoint(bipedLeftLeg, 0, 2, -8);
|
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) {
|
public void init(float yOffset, float stretch) {
|
||||||
// TODO: Splitting things like this isn't strictly neccessary and just complicates things.
|
// TODO: Splitting things like this isn't strictly neccessary and just complicates things.
|
||||||
initTextures();
|
initTextures();
|
||||||
|
|
|
@ -18,20 +18,12 @@ public class ModelMobPony extends ModelAlicorn {
|
||||||
super(false);
|
super(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the angle is to the right?
|
|
||||||
*/
|
|
||||||
public boolean islookAngleRight(float move) {
|
|
||||||
return MathHelper.sin(move / 20) < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
||||||
super.rotateLegs(move, swing, ticks, entity);
|
super.rotateLegs(move, swing, ticks, entity);
|
||||||
|
|
||||||
if (rightArmPose != ArmPose.EMPTY) {
|
if (rightArmPose != ArmPose.EMPTY) {
|
||||||
if (canCast()) {
|
if (canCast()) {
|
||||||
unicornArmRight.setRotationPoint(-7, 12, -2);
|
|
||||||
rotateArmHolding(unicornArmRight, -1, swingProgress, ticks);
|
rotateArmHolding(unicornArmRight, -1, swingProgress, ticks);
|
||||||
} else {
|
} else {
|
||||||
rotateArmHolding(bipedRightArm, -1, swingProgress, ticks);
|
rotateArmHolding(bipedRightArm, -1, swingProgress, ticks);
|
||||||
|
@ -40,7 +32,6 @@ public class ModelMobPony extends ModelAlicorn {
|
||||||
|
|
||||||
if (leftArmPose != ArmPose.EMPTY) {
|
if (leftArmPose != ArmPose.EMPTY) {
|
||||||
if (canCast()) {
|
if (canCast()) {
|
||||||
unicornArmRight.setRotationPoint(-7, 12, -2);
|
|
||||||
rotateArmHolding(unicornArmLeft, -1, swingProgress, ticks);
|
rotateArmHolding(unicornArmLeft, -1, swingProgress, ticks);
|
||||||
} else {
|
} else {
|
||||||
rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks);
|
rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks);
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.minelittlepony.model.player;
|
||||||
|
|
||||||
import com.minelittlepony.model.components.UnicornHorn;
|
import com.minelittlepony.model.components.UnicornHorn;
|
||||||
import com.minelittlepony.render.PonyRenderer;
|
import com.minelittlepony.render.PonyRenderer;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBiped.ArmPose;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.EnumHandSide;
|
import net.minecraft.util.EnumHandSide;
|
||||||
import net.minecraft.util.math.MathHelper;
|
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) {
|
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
||||||
super.rotateLegs(move, swing, ticks, entity);
|
super.rotateLegs(move, swing, ticks, entity);
|
||||||
|
|
||||||
unicornArmLeft.rotationPointX = 5;
|
unicornArmRight.setRotationPoint(-7, 12, -2);
|
||||||
unicornArmRight.rotationPointX = -5;
|
unicornArmLeft.setRotationPoint(-7, 12, -2);
|
||||||
|
|
||||||
unicornArmLeft.rotationPointY = unicornArmRight.rotationPointY = 8;
|
|
||||||
unicornArmLeft.rotationPointZ = unicornArmRight.rotationPointZ = 10;
|
|
||||||
|
|
||||||
unicornArmLeft.rotateAngleZ = 0;
|
unicornArmLeft.rotateAngleZ = 0;
|
||||||
unicornArmRight.rotateAngleZ = 0;
|
unicornArmRight.rotateAngleZ = 0;
|
||||||
|
|
|
@ -33,13 +33,6 @@ public class ModelSkeletonPony extends ModelMobPony {
|
||||||
super.setLivingAnimations(entity, move, swing, ticks);
|
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() {
|
protected float getLegOutset() {
|
||||||
if (isSleeping) return 2.6f;
|
if (isSleeping) return 2.6f;
|
||||||
if (isCrouching()) return 0;
|
if (isCrouching()) return 0;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.minelittlepony.model.ModelMobPony;
|
||||||
import com.minelittlepony.render.AbstractPonyRenderer;
|
import com.minelittlepony.render.AbstractPonyRenderer;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class ModelZombiePony extends ModelMobPony {
|
public class ModelZombiePony extends ModelMobPony {
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,19 +14,14 @@ public class ModelZombiePony extends ModelMobPony {
|
||||||
|
|
||||||
if (islookAngleRight(move)) {
|
if (islookAngleRight(move)) {
|
||||||
rotateArmHolding(bipedRightArm, 1, swingProgress, ticks);
|
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);
|
AbstractPonyRenderer.shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3);
|
||||||
} else {
|
} else {
|
||||||
|
rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks);
|
||||||
AbstractPonyRenderer.shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3);
|
AbstractPonyRenderer.shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean islookAngleRight(float move) {
|
||||||
|
return MathHelper.sin(move / 20) < 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue