diff --git a/src/main/java/com/brohoof/minelittlepony/model/ModelPony.java b/src/main/java/com/brohoof/minelittlepony/model/ModelPony.java index 25661893..ed517ab7 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/ModelPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/ModelPony.java @@ -204,7 +204,7 @@ public abstract class ModelPony extends ModelPlayer { rotate(180.0F, 0.0F, 1.0F, 0.0F); } - if (this.metadata.getSize() == PonySize.FOAL) { + if (this.metadata.getSize() == PonySize.FOAL || isChild) { if (this.isSneak && !this.isFlying && !this.isArmour) { translate(0.0F, -0.12F, 0.0F); } 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 39527a22..086cbf5b 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 @@ -507,7 +507,7 @@ public class pm_newPonyAdv extends ModelPony implements PonyModelConstants { rotate(180.0F, 0.0F, 1.0F, 0.0F); } - if (this.metadata.getSize() == PonySize.FOAL) { + if (this.metadata.getSize() == PonySize.FOAL || isChild) { if (this.isSneak && !this.isFlying && !this.isArmour) { translate(0.0F, -0.12F, 0.0F); } diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/pm_zombiePony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/pm_zombiePony.java index 1874ef69..16e671ef 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/pm_zombiePony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/pm_zombiePony.java @@ -14,6 +14,7 @@ public class pm_zombiePony extends pm_newPonyAdv { float leftLegRotateAngleX; float var8; float var9; + // why are zombies flying? if (this.isFlying && this.metadata.getRace().hasWings()) { if (this.rainboom) { rightArmRotateAngleX = ROTATE_270; diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyMob.java b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyMob.java index 2f836c26..176c0c69 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyMob.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyMob.java @@ -15,12 +15,11 @@ import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntityPigZombie; -import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; public abstract class RenderPonyMob extends RenderLiving implements IRenderPony { + protected ModelPony mobModel; protected PlayerModel playerModel; @@ -36,68 +35,23 @@ public abstract class RenderPonyMob extends RenderLiving } @Override - public void doRender(EntityLiving entity, double xPosition, double yPosition, double zPosition, float yaw, + public void doRender(Entity entity, double xPosition, double yPosition, double zPosition, float yaw, float partialTicks) { - ItemStack heldItem = entity.getHeldItem(); - this.playerModel.getModel().heldItemRight = heldItem == null ? 0 : 1; - - this.playerModel.getModel().isSneak = false; - this.playerModel.getModel().isFlying = false; - - if (entity instanceof EntitySkeleton) { - - switch (entity.getUniqueID().hashCode() % 3) { - case 0: - case 1: - this.playerModel.getModel().metadata.setRace(PonyRace.UNICORN); - break; - case 2: - this.playerModel.getModel().metadata.setRace(PonyRace.EARTH); - } - } else { - this.playerModel.getModel().metadata.setRace(PonyRace.EARTH); - } - - if (entity instanceof EntityPigZombie) { - this.playerModel.getModel().metadata.setGender(PonyGender.STALLION); - } else { - this.playerModel.getModel().metadata.setGender(PonyGender.MARE); - } - - if (entity instanceof EntitySkeleton) { - this.playerModel.getModel().metadata.setTail(TailLengths.STUB); - } else { - this.playerModel.getModel().metadata.setTail(TailLengths.FULL); - } - - this.playerModel.getModel().isSleeping = false; - if (MineLittlePony.getConfig().getShowScale().get()) { - this.shadowSize = 0.4F; - } - double yOrigin = yPosition; if (entity.isSneaking()) { yOrigin -= 0.125D; } - super.doRender(entity, xPosition, yOrigin, zPosition, yaw, partialTicks); this.playerModel.getModel().aimedBow = false; this.playerModel.getModel().isSneak = false; this.playerModel.getModel().heldItemRight = 0; } - @SuppressWarnings("unchecked") - @Override - public void doRender(Entity entity, double xPosition, double yPosition, double zPosition, float yaw, - float partialTicks) { - this.doRender((T) entity, xPosition, yPosition, zPosition, yaw, partialTicks); - } - protected abstract ResourceLocation getEntityTexture(T var1); @SuppressWarnings("unchecked") @Override - protected ResourceLocation getEntityTexture(Entity var1) { + protected final ResourceLocation getEntityTexture(Entity var1) { return this.getEntityTexture((T) var1); } @@ -105,7 +59,23 @@ public abstract class RenderPonyMob extends RenderLiving @SuppressWarnings("unchecked") @Override - protected void preRenderCallback(EntityLivingBase entitylivingbaseIn, float partialTickTime) { + protected final void preRenderCallback(EntityLivingBase entitylivingbaseIn, float partialTickTime) { + + ItemStack heldItem = entitylivingbaseIn.getHeldItem(); + this.playerModel.getModel().heldItemRight = heldItem == null ? 0 : 1; + + this.playerModel.getModel().isSneak = false; + this.playerModel.getModel().isFlying = false; + this.playerModel.getModel().isSleeping = false; + + this.playerModel.getModel().metadata.setRace(PonyRace.EARTH); + this.playerModel.getModel().metadata.setGender(PonyGender.MARE); + this.playerModel.getModel().metadata.setTail(TailLengths.FULL); + + if (MineLittlePony.getConfig().getShowScale().get()) { + this.shadowSize = 0.4F; + } + preRenderCallback((T) entitylivingbaseIn, partialTickTime); } @@ -115,7 +85,7 @@ public abstract class RenderPonyMob extends RenderLiving @SuppressWarnings("unchecked") @Override - protected void rotateCorpse(EntityLivingBase entity, float xPosition, float yPosition, float zPosition) { + protected final void rotateCorpse(EntityLivingBase entity, float xPosition, float yPosition, float zPosition) { this.rotateCorpse((T) entity, xPosition, yPosition, zPosition); } diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java index 02ecf17a..631696ce 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonySkeleton.java @@ -1,12 +1,15 @@ package com.brohoof.minelittlepony.renderer; +import java.util.Random; + import com.brohoof.minelittlepony.PonyManager; +import com.brohoof.minelittlepony.PonyRace; +import com.brohoof.minelittlepony.TailLengths; import com.brohoof.minelittlepony.model.PMAPI; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.util.ResourceLocation; @@ -28,10 +31,17 @@ public class RenderPonySkeleton extends RenderPonyMob { GlStateManager.scale(1.2F, 1.2F, 1.2F); } - } - - protected void a(EntityLivingBase entity, float partialTicks) { - this.preRenderCallback((EntitySkeleton) entity, partialTicks); + Random rand = new Random(skeleton.getUniqueID().hashCode()); + switch (rand.nextInt() % 3) { + 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); + } + this.playerModel.getModel().metadata.setTail(TailLengths.STUB); } @Override diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java index 28334653..13f6a40e 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/RenderPonyZombie.java @@ -1,6 +1,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.model.PMAPI; import net.minecraft.client.renderer.entity.RenderManager; @@ -14,10 +18,38 @@ public class RenderPonyZombie extends RenderPonyMob { super(rendermanager, PMAPI.zombie); } + @Override + protected void preRenderCallback(EntityZombie entity, float partick) { + Random rand = new Random(entity.getUniqueID().hashCode()); + + // 50-50 chance for gender + this.playerModel.getModel().metadata.setGender(rand.nextBoolean() ? PonyGender.MARE : PonyGender.STALLION); + + switch (rand.nextInt(5)) { + case 0: + case 1: + case 2: + this.playerModel.getModel().metadata.setRace(PonyRace.EARTH); + break; + case 3: + this.playerModel.getModel().metadata.setRace(PonyRace.PEGASUS); + break; + case 4: + 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); + } + } + @Override protected void rotateCorpse(EntityZombie zombie, float xPosition, float yPosition, float zPosition) { + super.rotateCorpse(zombie, xPosition, yPosition, zPosition); if (zombie.isConverting()) { - yPosition += (float) (Math.cos(zombie.ticksExisted * 3.25D) * 3.141592653589793D * 0.25D); + yPosition += (float) (Math.cos(zombie.ticksExisted * 3.25D) * Math.PI * 0.25D); } } diff --git a/src/main/resources/assets/minelittlepony/textures/entity/zombie/zombie_pony.png b/src/main/resources/assets/minelittlepony/textures/entity/zombie/zombie_pony.png index f82c7f8d..9a4a4953 100644 Binary files a/src/main/resources/assets/minelittlepony/textures/entity/zombie/zombie_pony.png and b/src/main/resources/assets/minelittlepony/textures/entity/zombie/zombie_pony.png differ