From 8dea16d563c3a7741bd8ccb1764821eee59a4e00 Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Tue, 15 Dec 2015 22:26:17 -0500 Subject: [PATCH] Add some more randomness to mobs, finish villagers. Fix skeleton rendering --- .../model/ModelVillagerPony.java | 127 ++++++++++++++++++ .../brohoof/minelittlepony/model/PMAPI.java | 1 + .../model/pony/pm_newPonyAdv.java | 91 +------------ .../model/pony/pm_skeletonPony.java | 4 - .../renderer/RenderPonySkeleton.java | 17 ++- .../renderer/RenderPonyVillager.java | 6 +- .../renderer/RenderPonyZombie.java | 28 +++- .../entity/skeleton/skeleton_pony.png | Bin 952 -> 1742 bytes 8 files changed, 169 insertions(+), 105 deletions(-) create mode 100644 src/main/java/com/brohoof/minelittlepony/model/ModelVillagerPony.java diff --git a/src/main/java/com/brohoof/minelittlepony/model/ModelVillagerPony.java b/src/main/java/com/brohoof/minelittlepony/model/ModelVillagerPony.java new file mode 100644 index 00000000..a53a1ca7 --- /dev/null +++ b/src/main/java/com/brohoof/minelittlepony/model/ModelVillagerPony.java @@ -0,0 +1,127 @@ +package com.brohoof.minelittlepony.model; + +import com.brohoof.minelittlepony.model.pony.pm_newPonyAdv; +import com.brohoof.minelittlepony.renderer.AniParams; +import com.brohoof.minelittlepony.renderer.PlaneRenderer; + +import net.minecraft.util.MathHelper; + +public class ModelVillagerPony extends pm_newPonyAdv { + + public PlaneRenderer[] VillagerBagPiece; + public PlaneRenderer VillagerApron; + public PlaneRenderer VillagerTrinket; + + public int profession; + + @Override + public void animate(AniParams aniparams) { + super.animate(aniparams); + float bodySwingRotation = 0.0F; + if (this.swingProgress > -9990.0F && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) { + bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F; + } + for (int i = 0; i < this.VillagerBagPiece.length; ++i) { + this.VillagerBagPiece[i].rotateAngleY = bodySwingRotation * 0.2F; + } + + this.VillagerBagPiece[4].rotateAngleY += 4.712389F; + this.VillagerBagPiece[5].rotateAngleY += 4.712389F; + this.VillagerBagPiece[6].rotateAngleY += 4.712389F; + this.VillagerBagPiece[7].rotateAngleY += 4.712389F; + this.VillagerApron.rotateAngleY = bodySwingRotation * 0.2F; + this.VillagerTrinket.rotateAngleY = bodySwingRotation * 0.2F; + } + + @Override + protected void adjustBodyComponents(float rotateAngleX, float rotationPointY, float rotationPointZ) { + super.adjustBodyComponents(rotateAngleX, rotationPointY, rotationPointZ); + + for (int i = 0; i < this.VillagerBagPiece.length; ++i) { + this.VillagerBagPiece[i].rotateAngleX = rotateAngleX; + this.VillagerBagPiece[i].rotationPointY = rotationPointY; + this.VillagerBagPiece[i].rotationPointZ = rotationPointZ; + } + + this.VillagerApron.rotateAngleX = rotateAngleX; + this.VillagerApron.rotationPointY = rotationPointY; + this.VillagerApron.rotationPointZ = rotationPointZ; + this.VillagerTrinket.rotateAngleX = rotateAngleX; + this.VillagerTrinket.rotationPointY = rotationPointY; + this.VillagerTrinket.rotationPointZ = rotationPointZ; + } + + @Override + protected void renderBody() { + super.renderBody(); + + if (profession < 2) { + for (int i = 0; i < this.VillagerBagPiece.length; ++i) { + this.VillagerBagPiece[i].render(this.scale); + } + } else if (profession == 2) { + this.VillagerTrinket.render(this.scale); + } else if (profession > 2) { + this.VillagerApron.render(this.scale); + } + } + + @Override + protected void initTextures() { + super.initTextures(); + this.VillagerBagPiece = new PlaneRenderer[14]; + this.VillagerBagPiece[0] = new PlaneRenderer(this, 56, 19); + this.VillagerBagPiece[1] = new PlaneRenderer(this, 56, 19); + this.VillagerBagPiece[2] = new PlaneRenderer(this, 56, 19); + this.VillagerBagPiece[3] = new PlaneRenderer(this, 56, 19); + this.VillagerBagPiece[4] = new PlaneRenderer(this, 56, 16); + this.VillagerBagPiece[5] = new PlaneRenderer(this, 56, 16); + this.VillagerBagPiece[6] = new PlaneRenderer(this, 56, 22); + this.VillagerBagPiece[7] = new PlaneRenderer(this, 56, 22); + this.VillagerBagPiece[8] = new PlaneRenderer(this, 56, 25); + this.VillagerBagPiece[9] = new PlaneRenderer(this, 56, 25); + this.VillagerBagPiece[10] = new PlaneRenderer(this, 59, 25); + this.VillagerBagPiece[11] = new PlaneRenderer(this, 59, 25); + this.VillagerBagPiece[12] = new PlaneRenderer(this, 56, 31); + this.VillagerBagPiece[13] = new PlaneRenderer(this, 56, 31); + this.VillagerApron = new PlaneRenderer(this, 56, 16); + this.VillagerTrinket = new PlaneRenderer(this, 0, 3); + } + + @Override + protected void initPositions(float yOffset, float stretch) { + super.initPositions(yOffset, stretch); + this.VillagerBagPiece[0].addSidePlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); + this.VillagerBagPiece[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[1].addSidePlane(-4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); + this.VillagerBagPiece[1].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[2].addSidePlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); + this.VillagerBagPiece[2].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[3].addSidePlane(7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); + this.VillagerBagPiece[3].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[4].addTopPlane(2.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -2.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); + this.VillagerBagPiece[4].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[5].addTopPlane(2.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -13.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); + this.VillagerBagPiece[5].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[6].addBottomPlane(2.0F + BODY_CENTRE_X, 1.0F + BODY_CENTRE_Y, -2.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); + this.VillagerBagPiece[6].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[7].addBottomPlane(2.0F + BODY_CENTRE_X, 1.0F + BODY_CENTRE_Y, -13.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); + this.VillagerBagPiece[7].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[8].addBackPlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); + this.VillagerBagPiece[8].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[9].addBackPlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); + this.VillagerBagPiece[9].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[10].addBackPlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, 4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); + this.VillagerBagPiece[10].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[11].addBackPlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, 4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); + this.VillagerBagPiece[11].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[12].addTopPlane(-4.0F + BODY_CENTRE_X, -4.5F + BODY_CENTRE_Y, -1.0F + BODY_CENTRE_Z, 8, 0, 1, stretch); + this.VillagerBagPiece[13].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerBagPiece[13].addTopPlane(-4.0F + BODY_CENTRE_X, -4.5F + BODY_CENTRE_Y, 0.0F + BODY_CENTRE_Z, 8, 0, 1, stretch); + this.VillagerBagPiece[13].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerApron.addBackPlane(-4.0F + BODY_CENTRE_X, -4.0F + BODY_CENTRE_Y, -9.0F + BODY_CENTRE_Z, 8, 10, 0, stretch); + this.VillagerApron.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.VillagerTrinket.addBackPlane(-2.0F + BODY_CENTRE_X, -4.0F + BODY_CENTRE_Y, -9.0F + BODY_CENTRE_Z, 4, 5, 0, stretch); + this.VillagerTrinket.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + } +} diff --git a/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java b/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java index f8732785..593debd7 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java +++ b/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java @@ -16,6 +16,7 @@ public final class PMAPI { public static final PlayerModel pony = new PlayerModel(new pm_newPonyAdv()).setArmor(new pma_newPony()); public static final PlayerModel zombie = new PlayerModel(new pm_zombiePony()).setArmor(new pma_zombiePony()); public static final PlayerModel skeleton = new PlayerModel(new pm_skeletonPony()).setArmor(new pma_skeletonPony()); + public static final PlayerModel villager = new PlayerModel(new ModelVillagerPony()).setArmor(new pma_newPony()); public static final PlayerModel human = new PlayerModel(new pm_Human()).setArmor(new pma_Human()); public static void init() { diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/pm_newPonyAdv.java b/src/main/java/com/brohoof/minelittlepony/model/pony/pm_newPonyAdv.java index 086cbf5b..b0222fa5 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/pm_newPonyAdv.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/pm_newPonyAdv.java @@ -29,9 +29,6 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { public ModelRenderer bipedCape; public PlaneRenderer[] Bodypiece; - public PlaneRenderer[] VillagerBagPiece; - public PlaneRenderer VillagerApron; - public PlaneRenderer VillagerTrinket; public PlaneRenderer[] BodypieceNeck; public ModelRenderer SteveArm; public ModelRenderer unicornarm; @@ -65,16 +62,6 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { this.Bodypiece[k1].rotateAngleY = bodySwingRotation * 0.2F; } - for (k1 = 0; k1 < this.VillagerBagPiece.length; ++k1) { - this.VillagerBagPiece[k1].rotateAngleY = bodySwingRotation * 0.2F; - } - - this.VillagerBagPiece[4].rotateAngleY += 4.712389F; - this.VillagerBagPiece[5].rotateAngleY += 4.712389F; - this.VillagerBagPiece[6].rotateAngleY += 4.712389F; - this.VillagerBagPiece[7].rotateAngleY += 4.712389F; - this.VillagerApron.rotateAngleY = bodySwingRotation * 0.2F; - this.VillagerTrinket.rotateAngleY = bodySwingRotation * 0.2F; for (k1 = 0; k1 < this.BodypieceNeck.length; ++k1) { this.BodypieceNeck[k1].rotateAngleY = bodySwingRotation * 0.2F; @@ -377,19 +364,6 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { this.Bodypiece[k3].rotationPointY = rotationPointY; this.Bodypiece[k3].rotationPointZ = rotationPointZ; } - - for (k3 = 0; k3 < this.VillagerBagPiece.length; ++k3) { - this.VillagerBagPiece[k3].rotateAngleX = rotateAngleX; - this.VillagerBagPiece[k3].rotationPointY = rotationPointY; - this.VillagerBagPiece[k3].rotationPointZ = rotationPointZ; - } - - this.VillagerApron.rotateAngleX = rotateAngleX; - this.VillagerApron.rotationPointY = rotationPointY; - this.VillagerApron.rotationPointZ = rotationPointZ; - this.VillagerTrinket.rotateAngleX = rotateAngleX; - this.VillagerTrinket.rotationPointY = rotationPointY; - this.VillagerTrinket.rotationPointZ = rotationPointZ; } protected void adjustNeck(float rotateAngleX, float rotationPointY, float rotationPointZ) { @@ -658,21 +632,6 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { this.Bodypiece[k1].render(this.scale); } - // TODO: villager data - //@formatter:off -// if (this.metadata.isVillager()) { -// if (this.metadata.getVillagerProfession() < 2) { -// for (k1 = 0; k1 < this.VillagerBagPiece.length; ++k1) { -// this.VillagerBagPiece[k1].render(this.scale); -// } -// } else if (this.metadata.getVillagerProfession() == 2) { -// this.VillagerTrinket.render(this.scale); -// } else if (this.metadata.getVillagerProfession() > 2) { -// this.VillagerApron.render(this.scale); -// } -// } - //@formatter:on - } protected void renderTail() { @@ -704,7 +663,6 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { this.Tail = new PlaneRenderer[21]; this.Bodypiece = new PlaneRenderer[14]; - this.VillagerBagPiece = new PlaneRenderer[14]; this.BodypieceNeck = new PlaneRenderer[4]; this.initHeadTextures(); this.initBodyTextures(); @@ -749,22 +707,6 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { this.BodypieceNeck[2] = new PlaneRenderer(this, 0, 16); this.BodypieceNeck[3] = new PlaneRenderer(this, 0, 16); - this.VillagerBagPiece[0] = new PlaneRenderer(this, 56, 19); - this.VillagerBagPiece[1] = new PlaneRenderer(this, 56, 19); - this.VillagerBagPiece[2] = new PlaneRenderer(this, 56, 19); - this.VillagerBagPiece[3] = new PlaneRenderer(this, 56, 19); - this.VillagerBagPiece[4] = new PlaneRenderer(this, 56, 16); - this.VillagerBagPiece[5] = new PlaneRenderer(this, 56, 16); - this.VillagerBagPiece[6] = new PlaneRenderer(this, 56, 22); - this.VillagerBagPiece[7] = new PlaneRenderer(this, 56, 22); - this.VillagerBagPiece[8] = new PlaneRenderer(this, 56, 25); - this.VillagerBagPiece[9] = new PlaneRenderer(this, 56, 25); - this.VillagerBagPiece[10] = new PlaneRenderer(this, 59, 25); - this.VillagerBagPiece[11] = new PlaneRenderer(this, 59, 25); - this.VillagerBagPiece[12] = new PlaneRenderer(this, 56, 31); - this.VillagerBagPiece[13] = new PlaneRenderer(this, 56, 31); - this.VillagerApron = new PlaneRenderer(this, 56, 16); - this.VillagerTrinket = new PlaneRenderer(this, 0, 3); } protected void initLegTextures() { @@ -866,38 +808,7 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { this.Bodypiece[12].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); this.Bodypiece[13].addBackPlane(-1.0F + BODY_CENTRE_X, 2.0F + BODY_CENTRE_Y, 8.0F + BODY_CENTRE_Z, 2, 2, 0, stretch); this.Bodypiece[13].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[0].addSidePlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); - this.VillagerBagPiece[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[1].addSidePlane(-4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); - this.VillagerBagPiece[1].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[2].addSidePlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); - this.VillagerBagPiece[2].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[3].addSidePlane(7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 0, 6, 8, stretch); - this.VillagerBagPiece[3].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[4].addTopPlane(2.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -2.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); - this.VillagerBagPiece[4].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[5].addTopPlane(2.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -13.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); - this.VillagerBagPiece[5].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[6].addBottomPlane(2.0F + BODY_CENTRE_X, 1.0F + BODY_CENTRE_Y, -2.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); - this.VillagerBagPiece[6].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[7].addBottomPlane(2.0F + BODY_CENTRE_X, 1.0F + BODY_CENTRE_Y, -13.0F + BODY_CENTRE_Z, 8, 0, 3, stretch); - this.VillagerBagPiece[7].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[8].addBackPlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); - this.VillagerBagPiece[8].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[9].addBackPlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); - this.VillagerBagPiece[9].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[10].addBackPlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, 4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); - this.VillagerBagPiece[10].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[11].addBackPlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, 4.0F + BODY_CENTRE_Z, 3, 6, 0, stretch); - this.VillagerBagPiece[11].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[12].addTopPlane(-4.0F + BODY_CENTRE_X, -4.5F + BODY_CENTRE_Y, -1.0F + BODY_CENTRE_Z, 8, 0, 1, stretch); - this.VillagerBagPiece[13].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerBagPiece[13].addTopPlane(-4.0F + BODY_CENTRE_X, -4.5F + BODY_CENTRE_Y, 0.0F + BODY_CENTRE_Z, 8, 0, 1, stretch); - this.VillagerBagPiece[13].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerApron.addBackPlane(-4.0F + BODY_CENTRE_X, -4.0F + BODY_CENTRE_Y, -9.0F + BODY_CENTRE_Z, 8, 10, 0, stretch); - this.VillagerApron.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); - this.VillagerTrinket.addBackPlane(-2.0F + BODY_CENTRE_X, -4.0F + BODY_CENTRE_Y, -9.0F + BODY_CENTRE_Z, 4, 5, 0, stretch); - this.VillagerTrinket.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); + this.BodypieceNeck[0].addBackPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -8.8F + BODY_CENTRE_Z, 4, 4, 0, stretch); this.BodypieceNeck[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); this.BodypieceNeck[1].addBackPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -4.8F + BODY_CENTRE_Z, 4, 4, 0, stretch); diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/pm_skeletonPony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/pm_skeletonPony.java index 3accdae0..ca99b3f4 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/pm_skeletonPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/pm_skeletonPony.java @@ -8,10 +8,6 @@ import static net.minecraft.client.renderer.GlStateManager.translate; import net.minecraft.util.MathHelper; public class pm_skeletonPony extends pm_newPonyAdv { - - public pm_skeletonPony() { - metadata.setGlowColor(0xff6666dd); - } @Override protected void rotateLegs(float move, float swing, float tick) { diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java index 631696ce..ffb708c9 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java @@ -2,8 +2,10 @@ package com.brohoof.minelittlepony.renderer; import java.util.Random; +import com.brohoof.minelittlepony.PonyGender; import com.brohoof.minelittlepony.PonyManager; import com.brohoof.minelittlepony.PonyRace; +import com.brohoof.minelittlepony.PonySize; import com.brohoof.minelittlepony.TailLengths; import com.brohoof.minelittlepony.model.PMAPI; @@ -19,8 +21,8 @@ public class RenderPonySkeleton extends RenderPonyMob { addLayer(new LayerBipedArmor(this) { @Override protected void initArmor() { - this.field_177189_c = PMAPI.skeleton.getModel(); - this.field_177186_d = PMAPI.skeleton.getModel(); + this.field_177189_c = PMAPI.skeleton.getArmor().modelArmor; + this.field_177186_d = PMAPI.skeleton.getArmor().modelArmorChestplate; } }); } @@ -32,16 +34,23 @@ public class RenderPonySkeleton extends RenderPonyMob { } Random rand = new Random(skeleton.getUniqueID().hashCode()); - switch (rand.nextInt() % 3) { + this.playerModel.getModel().metadata.setGender(rand.nextBoolean() ? PonyGender.MARE : PonyGender.STALLION); + switch (rand.nextInt(4)) { case 0: case 1: this.playerModel.getModel().metadata.setRace(PonyRace.UNICORN); - this.playerModel.getModel().metadata.setGlowColor(rand.nextInt()); break; case 2: this.playerModel.getModel().metadata.setRace(PonyRace.EARTH); + break; + case 3: + this.playerModel.getModel().metadata.setRace(PonyRace.PEGASUS); } + PonySize[] sizes = PonySize.values(); + PonySize size = sizes[rand.nextInt(sizes.length)]; + this.playerModel.getModel().metadata.setSize(size== PonySize.FOAL ? PonySize.NORMAL : size); this.playerModel.getModel().metadata.setTail(TailLengths.STUB); + this.playerModel.getModel().metadata.setGlowColor(rand.nextInt()); } @Override diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyVillager.java b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyVillager.java index 6f3927b5..a342f54a 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyVillager.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyVillager.java @@ -1,8 +1,9 @@ - package com.brohoof.minelittlepony.renderer; +package com.brohoof.minelittlepony.renderer; import com.brohoof.minelittlepony.MineLittlePony; import com.brohoof.minelittlepony.Pony; import com.brohoof.minelittlepony.model.PMAPI; +import com.brohoof.minelittlepony.model.ModelVillagerPony; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; @@ -12,7 +13,7 @@ import net.minecraft.util.ResourceLocation; public class RenderPonyVillager extends RenderPonyMob { public RenderPonyVillager(RenderManager rm) { - super(rm, PMAPI.pony); + super(rm, PMAPI.villager); } @Override @@ -26,6 +27,7 @@ public class RenderPonyVillager extends RenderPonyMob { this.shadowSize = 0.5F; } } + ((ModelVillagerPony)this.mainModel).profession = villager.getProfession(); GlStateManager.scale(0.9375F, 0.9375F, 0.9375F); } diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java index 13f6a40e..52fe634a 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java @@ -5,6 +5,8 @@ import java.util.Random; import com.brohoof.minelittlepony.PonyGender; import com.brohoof.minelittlepony.PonyManager; import com.brohoof.minelittlepony.PonyRace; +import com.brohoof.minelittlepony.PonySize; +import com.brohoof.minelittlepony.TailLengths; import com.brohoof.minelittlepony.model.PMAPI; import net.minecraft.client.renderer.entity.RenderManager; @@ -25,24 +27,40 @@ public class RenderPonyZombie extends RenderPonyMob { // 50-50 chance for gender this.playerModel.getModel().metadata.setGender(rand.nextBoolean() ? PonyGender.MARE : PonyGender.STALLION); - switch (rand.nextInt(5)) { + // races + switch (rand.nextInt(4)) { case 0: case 1: - case 2: this.playerModel.getModel().metadata.setRace(PonyRace.EARTH); break; - case 3: + case 2: this.playerModel.getModel().metadata.setRace(PonyRace.PEGASUS); break; - case 4: + case 3: this.playerModel.getModel().metadata.setRace(PonyRace.UNICORN); break; } - this.playerModel.getModel().metadata.setGlowColor(rand.nextInt()); // Let's play the lottery! if (rand.nextInt(10000) == 0) { this.playerModel.getModel().metadata.setRace(PonyRace.ALICORN); } + // sizes + if (entity.isChild()) { + this.playerModel.getModel().metadata.setSize(PonySize.FOAL); + } else { + PonySize size = randEnum(rand, PonySize.class); + this.playerModel.getModel().metadata.setSize(size != PonySize.FOAL ? size : PonySize.NORMAL); + } + this.playerModel.getModel().metadata.setTail(randEnum(rand, TailLengths.class)); + + // glow + this.playerModel.getModel().metadata.setGlowColor(rand.nextInt()); + + } + + private > T randEnum(Random rand, Class en) { + T[] values = en.getEnumConstants(); + return values[rand.nextInt(values.length)]; } @Override 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 843cb75883f14d3d6bf0c43c7b84af433fe90884..982d29bf11162cf401f8b623d4d2d04a33e3e229 100644 GIT binary patch delta 1727 zcmV;w20;0^2hI(UBYyw}VoOIv0RI600RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_ z000McNliru-wY4}DGh@riTnTn23tu)K~#9!?OVNy+e#Gv##q+MmSZh8NgQ92C&+FW z$OD8B@&czEayhePb|?~nCy&S4k^ z0DyB20H{{0;+Zhi>vhlHC(k=PJoKi`fByXW%-@KD#LlxnCOXg0&vA5g&*$N~E(U|a zgc%S6wrv9d3WY-G%Q~G7T-TlGr@4;f1UgOFP^nZ{)I4J40%$ZE9%%po=(-NaaiFRya=9E#(-aTqayi_%aRaXF;^)tw z==b|57K<=VQ_ML#I}-vR$4R?Pb}f7ObqgUOhkq?aQQ*2RT-OEX9H*zJ0D$A;W9;tk zVrORu*REZ|_VzZ8kB?C-7IAud3eLHhrznbeAH7@7BQ_1me!mY@Rgp@i;JPmQ{XRyc z5e&n?*47q2efos2U%%3Bq1)}^!-o%|@5z%VV&@&lK{}mAI-SN~FhIZG7h#h^q^4;w z41YuPtz7`*rO8td1_NlC23^;Y&1L}rj~+e3>({Swa&iIyc>DIPc)|AeHhR4t9LEXt z+Ch25v`~8GK7gE{s;Y1t2ia^Ey?ZTav1*W%eU)}vq>?A2OKYy)k-fT7} z`l7CH7M=9h-WH|(2byV&`;XU_WsUiOgM$N4)3m8RAi{b*0PMm9$PfHZg=sM|GmFxk zbJS`zMjBA7)dUl@T8$C&wOWmZReY%u9aeCSus(J{3&v?YA=l;P)7-o?_0dj}5bE{1 zN6F8N7cV?wUVhepdd%nZD1R1<2&)@jW_=RPY};o3@uXY~@z(+8q0i3FCPJRP`$2S2 z*rcj*7%scM0NMkf{FDdg zrK3Ww{Q6BoRaHb?-z+-W@Auc5o632Bs;XmJP%f86(RQUJu}y(ontzKCBSwrEF=E7s z5hF&77%^hRSQVCjT}_|a`|kv(&@roq7y4au{qi+Mk?(dg9Kh}V& z_5n+{zmJ5d|5KD$hRVzLc~?!Z-3Q1YL9c_}7$>;ud;BnZV+0WOJA* z9tM|iZy$+Xy9O-r-Z=hJ^x6eL-`pQ8f(sE`2!aoBA-HklS`b{h zk+<^$-hbqA3g>d}+*H%1Y3n7!9nwkDI&(5JnI^aR`{$o4gx2e|Tdh_<`ew74L(6M$ z5kMTPY~THgi`3-GzwZhy77Mr8Y@8au-|tIS075|EvuN>NAAbM@*Vh(Z6Oji1yr%Im zpbCKLbn29S091JZf%UbW7`E451IK;h+EzBntrht3sex4*&q$?be~)?RHMXK(DRwJ^-phfQI{Gy7weF9*^De zcq|P92s$h34S$f~CAfyiSO7v+fvTLt+~R9H@c;mT+4mX5d_WH%htANuOx}AA&?E?E zE&w28tO)cFx-?e_j=?hu6ul|7j_AaA1ptP@5VY_Nv}DNF>(yN@mr|zp=ralcIJS;R zPBetG4+V8)!2Qu^%$n%JdMV?2xMp-(R&DxwI(>9&!v&{0FI#tfH8*gPft(|ts@5E1-2$2 z5SV%NF$5U<3>%EqXZbF>)Y&?s7!pBw)&yGIpdYgj*S_6uB>tNJPvp?b&u08KvVN?7o&7+nnm#!Id?DggvwB@a zSW~cV3xKxtOa24)!)CAmy!#w|#~RzOV%^^Jjq}w8vHArApoy!Ftc)d)tj787g>tNZ z!2oD=R!8QiEBe&9SJ(Q16zTy@^$Xs%R%7bO7JmS1tWQ<|LOr3We#t#RKXPd7Dp=$m+K zZMUgIx2R&D&j55yZ5*v7J^D&bZJpycm3s#u=2W>2c`yLPp5r%_vj^lP*fTXfw{J`C z9e}3i_HD_7DSczl@tewn0iZAL9e~*5>l}|i{{D0T{sXW?$?faliC_Q#002ovPDHLk FV1k#szzP5W