From 10c451449292bf100d3a1651d5d93ca1a809144e Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Wed, 9 Mar 2016 17:05:14 -0500 Subject: [PATCH] Revert "Add some model children. May be buggy" This reverts commit 57404a01cf1bfb112abfec729f1c5b6217d6f484. --- .../model/part/AbstractHeadPart.java | 6 ----- .../model/part/PegasusWings.java | 11 --------- .../minelittlepony/model/part/PonyEars.java | 4 ---- .../minelittlepony/model/part/PonySnout.java | 10 -------- .../model/part/UnicornHorn.java | 20 ++++++---------- .../model/pony/ModelVillagerPony.java | 24 ++++++++++++++----- .../renderer/RenderPonySkeleton.java | 4 ++-- 7 files changed, 27 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/brohoof/minelittlepony/model/part/AbstractHeadPart.java b/src/main/java/com/brohoof/minelittlepony/model/part/AbstractHeadPart.java index 55b5e6df..916db634 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/AbstractHeadPart.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/AbstractHeadPart.java @@ -4,7 +4,6 @@ import com.brohoof.minelittlepony.PonyData; import com.brohoof.minelittlepony.model.BodyPart; import com.brohoof.minelittlepony.model.AbstractPonyModel; -import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; public abstract class AbstractHeadPart implements IPonyPart { @@ -14,9 +13,6 @@ public abstract class AbstractHeadPart implements IPonyPart { @Override public void init(AbstractPonyModel pony, float yOffset, float stretch) { this.pony = pony; - for (ModelRenderer m : getModels()) { - this.pony.bipedHead.addChild(m); - } } @Override @@ -55,8 +51,6 @@ public abstract class AbstractHeadPart implements IPonyPart { return pony; } - protected abstract ModelRenderer[] getModels(); - protected abstract void position(float posX, float posY, float posZ); protected abstract void rotate(float rotX, float rotY); diff --git a/src/main/java/com/brohoof/minelittlepony/model/part/PegasusWings.java b/src/main/java/com/brohoof/minelittlepony/model/part/PegasusWings.java index b48c4d34..ca59fb67 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/PegasusWings.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/PegasusWings.java @@ -41,17 +41,6 @@ public class PegasusWings implements IPonyPart, PonyModelConstants { } initPositions(yOffset, stretch); - - addChildren(this.leftWing); - addChildren(this.rightWing); - addChildren(this.leftWingExt); - addChildren(this.rightWingExt); - } - - private void addChildren(ModelRenderer... models) { - for (ModelRenderer m : models) { - this.pony.bipedBody.addChild(m); - } } private void initPositions(float yOffset, float stretch) { diff --git a/src/main/java/com/brohoof/minelittlepony/model/part/PonyEars.java b/src/main/java/com/brohoof/minelittlepony/model/part/PonyEars.java index 8c947beb..b4a3ff3a 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/PonyEars.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/PonyEars.java @@ -45,8 +45,4 @@ public class PonyEars extends AbstractHeadPart implements PonyModelConstants { right.render(scale); } - @Override - protected ModelRenderer[] getModels() { - return new ModelRenderer[] { left, right }; - } } diff --git a/src/main/java/com/brohoof/minelittlepony/model/part/PonySnout.java b/src/main/java/com/brohoof/minelittlepony/model/part/PonySnout.java index f672306e..72922a1c 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/PonySnout.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/PonySnout.java @@ -9,9 +9,6 @@ import com.brohoof.minelittlepony.model.AbstractPonyModel; import com.brohoof.minelittlepony.model.PonyModelConstants; import com.brohoof.minelittlepony.renderer.PlaneRenderer; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ObjectArrays; - -import net.minecraft.client.model.ModelRenderer; public class PonySnout extends AbstractHeadPart implements PonyModelConstants { @@ -106,11 +103,4 @@ public class PonySnout extends AbstractHeadPart implements PonyModelConstants { } } - @Override - protected ModelRenderer[] getModels() { - ModelRenderer[] male = MUZZLES.get(PonyGender.STALLION); - ModelRenderer[] female = MUZZLES.get(PonyGender.MARE); - return ObjectArrays.concat(male, female, ModelRenderer.class); - } - } diff --git a/src/main/java/com/brohoof/minelittlepony/model/part/UnicornHorn.java b/src/main/java/com/brohoof/minelittlepony/model/part/UnicornHorn.java index 9c8d9cb7..199a47b9 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/UnicornHorn.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/UnicornHorn.java @@ -24,7 +24,6 @@ public class UnicornHorn extends AbstractHeadPart implements PonyModelConstants this.hornglow = new HornGlowRenderer[2]; for (int i = 0; i < hornglow.length; i++) { this.hornglow[i] = new HornGlowRenderer(pony, 0, 3); - this.horn.addChild(this.hornglow[i]); } this.horn.addBox(-0.5F + HEAD_CENTRE_X, -10.0F + HEAD_CENTRE_Y, -1.5F + HEAD_CENTRE_Z, 1, 4, 1, stretch); @@ -67,9 +66,9 @@ public class UnicornHorn extends AbstractHeadPart implements PonyModelConstants protected void position(float posX, float posY, float posZ) { AbstractPonyModel.setRotationPoint(this.horn, posX, posY, posZ); -// for (int i = 0; i < this.hornglow.length; i++) { -// AbstractPonyModel.setRotationPoint(this.hornglow[i], posX, posY, posZ); -// } + for (int i = 0; i < this.hornglow.length; i++) { + AbstractPonyModel.setRotationPoint(this.hornglow[i], posX, posY, posZ); + } } protected void rotate(float rotX, float rotY) { @@ -77,15 +76,10 @@ public class UnicornHorn extends AbstractHeadPart implements PonyModelConstants this.horn.rotateAngleX = rotX + 0.5F; this.horn.rotateAngleY = rotY; -// for (int i = 0; i < this.hornglow.length; i++) { -// this.hornglow[i].rotateAngleX = rotX + 0.5F; -// this.hornglow[i].rotateAngleY = rotY; -// } + for (int i = 0; i < this.hornglow.length; i++) { + this.hornglow[i].rotateAngleX = rotX + 0.5F; + this.hornglow[i].rotateAngleY = rotY; + } } - @Override - protected ModelRenderer[] getModels() { - // TODO Auto-generated method stub - return new ModelRenderer[] { horn }; - } } diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java index 1abb1613..c96793dc 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java @@ -35,6 +35,24 @@ public class ModelVillagerPony extends ModelPlayerPony { 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(); @@ -70,12 +88,6 @@ public class ModelVillagerPony extends ModelPlayerPony { this.VillagerBagPiece[13] = new PlaneRenderer(this, 56, 31); this.VillagerApron = new PlaneRenderer(this, 56, 16); this.VillagerTrinket = new PlaneRenderer(this, 0, 3); - - for (PlaneRenderer p : this.VillagerBagPiece) { - this.bipedBody.addChild(p); - } - this.bipedBody.addChild(this.VillagerApron); - this.bipedBody.addChild(this.VillagerTrinket); } @Override diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java index 5362d463..7df286bf 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java @@ -21,8 +21,8 @@ public class RenderPonySkeleton extends RenderPonyMob { addLayer(new LayerBipedArmor(this) { @Override protected void initArmor() { - this.modelLeggings = PMAPI.skeleton.getArmor().modelArmor; - this.modelArmor = PMAPI.skeleton.getArmor().modelArmorChestplate; + this.field_177189_c = PMAPI.skeleton.getArmor().modelArmor; + this.field_177186_d = PMAPI.skeleton.getArmor().modelArmorChestplate; } }); }