From 566bdce0a961b0df3a3a3741fdcb11b2d63daad3 Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Fri, 20 May 2016 16:22:31 -0400 Subject: [PATCH] Make arms stretch out when elytra flying # Conflicts: # src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java # Conflicts: # src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java --- .../model/pony/ModelPlayerPony.java | 17 ++++++++--------- .../model/pony/ModelSkeletonPony.java | 6 ++++-- .../model/pony/ModelZombiePony.java | 6 ++++-- .../model/pony/armor/ModelPonyArmor.java | 7 ++++--- .../pony/armor/ModelSkeletonPonyArmor.java | 6 ++++-- .../model/pony/armor/ModelZombiePonyArmor.java | 6 ++++-- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java index 76b55239..0a5c5fa0 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java @@ -78,7 +78,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.bipedHead.offsetZ = 0f; this.bipedHeadwear.offsetY = 0f; this.bipedHeadwear.offsetZ = 0f; - this.setLegs(move, swing, tick); + this.setLegs(move, swing, tick, entity); this.holdItem(); this.swingItem(entity, this.swingProgress); if (this.isSneak && !this.isFlying) { @@ -163,11 +163,10 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst } protected void checkRainboom(Entity entity, float swing) { - this.rainboom = this.metadata.getRace() != null && this.metadata.getRace().hasWings() && this.isFlying && swing >= 0.9999F; + boolean flying = this.metadata.getRace() != null && this.metadata.getRace().hasWings() && this.isFlying + || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying(); - if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) { - this.rainboom = true; - } + this.rainboom = flying && swing >= 0.9999F; } protected void setHead(float posX, float posY, float posZ) { @@ -196,17 +195,17 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.bipedHeadwear.rotateAngleX = headRotateAngleX; } - protected void setLegs(float move, float swing, float tick) { - this.rotateLegs(move, swing, tick); + protected void setLegs(float move, float swing, float tick, Entity entity) { + this.rotateLegs(move, swing, tick, entity); this.adjustLegs(); } - protected void rotateLegs(float move, float swing, float tick) { + protected void rotateLegs(float move, float swing, float tick, Entity entity) { float rightArmRotateAngleX; float leftArmRotateAngleX; float rightLegRotateAngleX; float leftLegRotateAngleX; - if (this.isFlying && this.metadata.getRace().hasWings()) { + if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) { if (this.rainboom) { rightArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270; diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java index 6d1fe9a5..f0280a9a 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java @@ -2,6 +2,8 @@ package com.brohoof.minelittlepony.model.pony; import static net.minecraft.client.renderer.GlStateManager.*; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.math.MathHelper; public class ModelSkeletonPony extends ModelPlayerPony { @@ -11,7 +13,7 @@ public class ModelSkeletonPony extends ModelPlayerPony { } @Override - protected void rotateLegs(float move, float swing, float tick) { + protected void rotateLegs(float move, float swing, float tick, Entity entity) { float rightArmRotateAngleX; float leftArmRotateAngleX; @@ -19,7 +21,7 @@ public class ModelSkeletonPony extends ModelPlayerPony { float leftLegRotateAngleX; float var8; float var9; - if (this.isFlying && this.metadata.getRace().hasWings()) { + if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) { if (this.rainboom) { rightArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270; diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java index 66d3d65c..661c083d 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java @@ -1,5 +1,7 @@ package com.brohoof.minelittlepony.model.pony; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.math.MathHelper; public class ModelZombiePony extends ModelPlayerPony { @@ -9,7 +11,7 @@ public class ModelZombiePony extends ModelPlayerPony { } @Override - protected void rotateLegs(float move, float swing, float tick) { + protected void rotateLegs(float move, float swing, float tick, Entity entity) { float rightArmRotateAngleX; float leftArmRotateAngleX; float rightLegRotateAngleX; @@ -17,7 +19,7 @@ public class ModelZombiePony extends ModelPlayerPony { float var8; float var9; // why are zombies flying? - if (this.isFlying && this.metadata.getRace().hasWings()) { + if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) { if (this.rainboom) { rightArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270; diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java index f68d3f02..9871eb8e 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java @@ -41,7 +41,7 @@ public class ModelPonyArmor extends ModelPlayerPony { this.extHead[0].offsetZ = 0f; this.extHead[1].offsetY = 0f; this.extHead[1].offsetZ = 0f; - this.setLegs(move, swing, tick); + this.setLegs(move, swing, tick, entity); this.holdItem(); this.swingItem(entity, this.swingProgress); if (this.isSneak && !this.isFlying) { @@ -198,6 +198,7 @@ public class ModelPonyArmor extends ModelPlayerPony { this.bipedLeftLeg.mirror = true; this.steveRightArm = new ModelRenderer(this, 0, 16); this.unicornArmRight = new ModelRenderer(this, 0, 16); + this.unicornArmLeft = new ModelRenderer(this, 0, 16); this.extLegs[0] = new ModelRenderer(this, 48, 8); this.extLegs[1] = new ModelRenderer(this, 48, 8); this.extLegs[1].mirror = true; @@ -272,8 +273,8 @@ public class ModelPonyArmor extends ModelPlayerPony { } @Override - protected void rotateLegs(float move, float swing, float tick) { - super.rotateLegs(move, swing, tick); + protected void rotateLegs(float move, float swing, float tick, Entity entity) { + super.rotateLegs(move, swing, tick, entity); this.syncLegs(); } diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java index c802ad7d..e7629b55 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java @@ -1,18 +1,20 @@ package com.brohoof.minelittlepony.model.pony.armor; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.math.MathHelper; public class ModelSkeletonPonyArmor extends ModelPonyArmor { @Override - protected void rotateLegs(float move, float swing, float tick) { + protected void rotateLegs(float move, float swing, float tick, Entity entity) { float rightArmRotateAngleX; float leftArmRotateAngleX; float rightLegRotateAngleX; float leftLegRotateAngleX; float var8; float var9; - if (this.isFlying && this.metadata.getRace().hasWings()) { + if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) { if (this.rainboom) { rightArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270; diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java index c81d6fb1..44e5f8d5 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java @@ -1,18 +1,20 @@ package com.brohoof.minelittlepony.model.pony.armor; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.math.MathHelper; public class ModelZombiePonyArmor extends ModelPonyArmor { @Override - protected void rotateLegs(float move, float swing, float tick) { + protected void rotateLegs(float move, float swing, float tick, Entity entity) { float rightArmRotateAngleX; float leftArmRotateAngleX; float rightLegRotateAngleX; float leftLegRotateAngleX; float var8; float var9; - if (this.isFlying && this.metadata.getRace().hasWings()) { + if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) { if (this.rainboom) { rightArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270;