diff --git a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java index 37a75d72..b56de29a 100644 --- a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java +++ b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java @@ -126,7 +126,9 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { animateWears(); - snout.setGender(metadata.getGender()); + if (snout != null) { + snout.setGender(metadata.getGender()); + } } protected void adjustBodyRiding() { @@ -243,17 +245,15 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { float spread = getLegSpread(); bipedRightArm.rotationPointZ = spread + sin; - bipedLeftArm.rotationPointZ = spread - sin; - float legOutset = getLegOutset(); - float rpxl = cos + 1 - legOutset; - float rpxr = legOutset - cos - 1; + float legRPX = cos - getLegOutset(); - bipedRightArm.rotationPointX = rpxr; - bipedRightLeg.rotationPointX = rpxr; - bipedLeftArm.rotationPointX = rpxl; - bipedLeftLeg.rotationPointX = rpxl; + bipedRightArm.rotationPointX = -legRPX; + bipedRightLeg.rotationPointX = -legRPX; + + bipedLeftArm.rotationPointX = legRPX; + bipedLeftLeg.rotationPointX = legRPX; bipedRightArm.rotateAngleY += bipedBody.rotateAngleY; bipedLeftArm.rotateAngleY += bipedBody.rotateAngleY; @@ -536,15 +536,15 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { float rarmX = getLegRotationX(); float rarmY = getArmRotationY(); - float armX = THIRDP_ARM_CENTRE_X - 2; + float armX = THIRDP_ARM_CENTRE_X; float armY = THIRDP_ARM_CENTRE_Y - 6; - float armZ = THIRDP_ARM_CENTRE_Z - 2; + float armZ = BODY_CENTRE_Z / 2 - 1 - armDepth; bipedLeftArm .addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch); - bipedRightArm.addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch); + bipedRightArm.addBox(armX - armWidth, armY, armZ, armWidth, 12, armDepth, stretch); bipedLeftLeg .addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch); - bipedRightLeg.addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch); + bipedRightLeg.addBox(armX - armWidth, armY, armZ, armWidth, 12, armDepth, stretch); bipedLeftArm .setRotationPoint( rarmX, yOffset + rarmY, 0); bipedRightArm.setRotationPoint(-rarmX, yOffset + rarmY, 0); @@ -554,22 +554,22 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel { if (bipedLeftArmwear != null) { bipedLeftArmwear.addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch + 0.25f); - bipedLeftArmwear.setRotationPoint(3, yOffset + rarmY, 0); + bipedLeftArmwear.setRotationPoint(rarmX, yOffset + rarmY, 0); } if (bipedRightArmwear != null) { - bipedRightArmwear.addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch + 0.25f); - bipedRightArmwear.setRotationPoint(-3, yOffset + rarmY, 0); + bipedRightArmwear.addBox(armX - armWidth, armY, armZ, armWidth, 12, armDepth, stretch + 0.25f); + bipedRightArmwear.setRotationPoint(-rarmX, yOffset + rarmY, 0); } if (bipedLeftLegwear != null) { bipedLeftLegwear.addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch + 0.25f); - bipedRightLegwear.setRotationPoint(3, yOffset, 0); + bipedRightLegwear.setRotationPoint(rarmX, yOffset, 0); } if (bipedRightLegwear != null) { - bipedRightLegwear.addBox(armX, armY, armZ, armWidth, 12, armDepth, stretch + 0.25f); - bipedRightLegwear.setRotationPoint(-3, yOffset, 0); + bipedRightLegwear.addBox(armX - armWidth, armY, armZ, armWidth, 12, armDepth, stretch + 0.25f); + bipedRightLegwear.setRotationPoint(-rarmX, yOffset, 0); } } diff --git a/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java b/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java index 7804a868..00f7e753 100644 --- a/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java +++ b/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java @@ -175,12 +175,18 @@ public class ModelPonyArmor extends ModelMobPony { protected void initLegPositions(float yOffset, float stretch) { super.initLegPositions(yOffset, stretch); - leftLegging.offset(THIRDP_ARM_CENTRE_X, THIRDP_ARM_CENTRE_Y, THIRDP_ARM_CENTRE_Z) - .around(3, yOffset, 0) - .box(-2, -6, -2, 4, 12, 4, stretch); - rightLegging.offset(THIRDP_ARM_CENTRE_X, THIRDP_ARM_CENTRE_Y, THIRDP_ARM_CENTRE_Z) - .around(-3, yOffset, 0) - .flipX().box(-2, -6, -2, 4, 12, 4, stretch); + float rarmX = getLegRotationX(); + + float armX = THIRDP_ARM_CENTRE_X; + float armY = THIRDP_ARM_CENTRE_Y; + float armZ = THIRDP_ARM_CENTRE_Z; + + leftLegging.offset(armX + 2, armY, armZ) + .around(rarmX, yOffset, 0) + .box(-2, -6, -2, 4, 12, 4, stretch); + rightLegging.offset(armX - 2, armY, armZ) + .around(-rarmX, yOffset, 0) + .flipX().box(-2, -6, -2, 4, 12, 4, stretch); } protected void syncLegs() { diff --git a/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java b/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java index 92804b3b..f66d83c9 100644 --- a/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java +++ b/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java @@ -20,7 +20,9 @@ public class ModelEarthPony extends AbstractPonyModel { public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) { super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity); - bipedCape.rotationPointY = isSneak ? 2 : isRiding ? -4 : 0; + if (bipedCape != null) { + bipedCape.rotationPointY = isSneak ? 2 : isRiding ? -4 : 0; + } } protected float getLegOutset() { @@ -40,15 +42,6 @@ public class ModelEarthPony extends AbstractPonyModel { return smallArms ? 8.5f : super.getArmRotationY(); } - protected void adjustLegs(float move, float swing, float tick) { - super.adjustLegs(move, swing, tick); - // Push the front legs back apart if we're a thin pony - if (smallArms) { - bipedLeftArm.rotationPointX++; - bipedLeftLeg.rotationPointX++; - } - } - protected void initHeadTextures() { super.initHeadTextures(); bipedCape = new PonyRenderer(this, 0, 0).size(64, 32); @@ -59,13 +52,6 @@ public class ModelEarthPony extends AbstractPonyModel { bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, stretch); } - protected void initLegPositions(float yOffset, float stretch) { - super.initLegPositions(yOffset, stretch); - if (smallArms) { - - } - } - @Override public void renderCape(float scale) { bipedCape.render(scale); diff --git a/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java b/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java index db2ed133..586ccfa6 100644 --- a/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java +++ b/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java @@ -1,12 +1,9 @@ package com.minelittlepony.model.ponies; -import static net.minecraft.client.renderer.GlStateManager.*; - import com.minelittlepony.model.ModelMobPony; import com.minelittlepony.model.armour.ModelSkeletonPonyArmor; import com.minelittlepony.model.armour.PonyArmor; -import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.AbstractSkeleton; import net.minecraft.init.Items; @@ -51,40 +48,19 @@ public class ModelSkeletonPony extends ModelMobPony { } } - // TODO: HACK It would be better to just change the size of the legs. - private void renderScaledArm(ModelRenderer arm, float x, float y, float z) { - scale(x, y, z); - x /= 1.5f; - z /= 1.5f; - arm.rotateAngleX /= x; - arm.rotateAngleY /= y; - arm.rotateAngleZ /= z; - arm.render(scale); - arm.rotateAngleX *= x; - arm.rotateAngleY *= y; - arm.rotateAngleZ *= z; + protected int getArmWidth() { + return 2; } - @Override - protected void renderLegs() { - pushMatrix(); - translate(0.05F, -0.21F, 0); - renderScaledArm(bipedLeftArm, 0.5F, 1.15F, 0.5F); - popMatrix(); + protected int getArmDepth() { + return 2; + } - pushMatrix(); - translate(-0.05F, -0.21F, 0); - renderScaledArm(bipedRightArm, 0.5F, 1.2F, 0.5F); - popMatrix(); + protected float getLegRotationX() { + return 3; + } - pushMatrix(); - translate(0.05F, -0.21F, 0.35F); - renderScaledArm(bipedLeftLeg, 0.5F, 1.2F, 0.5F); - popMatrix(); - - pushMatrix(); - translate(-0.05F, -0.21F, 0.35F); - renderScaledArm(bipedRightLeg, 0.5F, 1.15F, 0.5F); - popMatrix(); + protected float getArmRotationY() { + return 8; } } diff --git a/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_pony.png b/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_pony.png index 843cb758..c9ea7d7b 100644 Binary files a/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_pony.png and b/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_pony.png differ diff --git a/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_wither_pony.png b/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_wither_pony.png index 88f51bfa..46efb341 100644 Binary files a/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_wither_pony.png and b/src/main/resources/assets/minelittlepony/textures/entity/skeleton/skeleton_wither_pony.png differ diff --git a/src/main/resources/assets/minelittlepony/textures/entity/skeleton/stray_pony.png b/src/main/resources/assets/minelittlepony/textures/entity/skeleton/stray_pony.png index 6dc56927..bfa73b6d 100644 Binary files a/src/main/resources/assets/minelittlepony/textures/entity/skeleton/stray_pony.png and b/src/main/resources/assets/minelittlepony/textures/entity/skeleton/stray_pony.png differ