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
This commit is contained in:
Matthew Messinger 2016-05-20 16:22:31 -04:00
parent f9ebdd8867
commit 566bdce0a9
6 changed files with 28 additions and 20 deletions

View file

@ -78,7 +78,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
this.bipedHead.offsetZ = 0f; this.bipedHead.offsetZ = 0f;
this.bipedHeadwear.offsetY = 0f; this.bipedHeadwear.offsetY = 0f;
this.bipedHeadwear.offsetZ = 0f; this.bipedHeadwear.offsetZ = 0f;
this.setLegs(move, swing, tick); this.setLegs(move, swing, tick, entity);
this.holdItem(); this.holdItem();
this.swingItem(entity, this.swingProgress); this.swingItem(entity, this.swingProgress);
if (this.isSneak && !this.isFlying) { if (this.isSneak && !this.isFlying) {
@ -163,11 +163,10 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
} }
protected void checkRainboom(Entity entity, float swing) { 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 = flying && swing >= 0.9999F;
this.rainboom = true;
}
} }
protected void setHead(float posX, float posY, float posZ) { protected void setHead(float posX, float posY, float posZ) {
@ -196,17 +195,17 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
this.bipedHeadwear.rotateAngleX = headRotateAngleX; this.bipedHeadwear.rotateAngleX = headRotateAngleX;
} }
protected void setLegs(float move, float swing, float tick) { protected void setLegs(float move, float swing, float tick, Entity entity) {
this.rotateLegs(move, swing, tick); this.rotateLegs(move, swing, tick, entity);
this.adjustLegs(); 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 rightArmRotateAngleX;
float leftArmRotateAngleX; float leftArmRotateAngleX;
float rightLegRotateAngleX; float rightLegRotateAngleX;
float leftLegRotateAngleX; 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) { if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270; rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270;

View file

@ -2,6 +2,8 @@ package com.brohoof.minelittlepony.model.pony;
import static net.minecraft.client.renderer.GlStateManager.*; import static net.minecraft.client.renderer.GlStateManager.*;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
public class ModelSkeletonPony extends ModelPlayerPony { public class ModelSkeletonPony extends ModelPlayerPony {
@ -11,7 +13,7 @@ public class ModelSkeletonPony extends ModelPlayerPony {
} }
@Override @Override
protected void rotateLegs(float move, float swing, float tick) { protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX; float rightArmRotateAngleX;
float leftArmRotateAngleX; float leftArmRotateAngleX;
@ -19,7 +21,7 @@ public class ModelSkeletonPony extends ModelPlayerPony {
float leftLegRotateAngleX; float leftLegRotateAngleX;
float var8; float var8;
float var9; 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) { if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270; rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270;

View file

@ -1,5 +1,7 @@
package com.brohoof.minelittlepony.model.pony; package com.brohoof.minelittlepony.model.pony;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
public class ModelZombiePony extends ModelPlayerPony { public class ModelZombiePony extends ModelPlayerPony {
@ -9,7 +11,7 @@ public class ModelZombiePony extends ModelPlayerPony {
} }
@Override @Override
protected void rotateLegs(float move, float swing, float tick) { protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX; float rightArmRotateAngleX;
float leftArmRotateAngleX; float leftArmRotateAngleX;
float rightLegRotateAngleX; float rightLegRotateAngleX;
@ -17,7 +19,7 @@ public class ModelZombiePony extends ModelPlayerPony {
float var8; float var8;
float var9; float var9;
// why are zombies flying? // 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) { if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270; rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270;

View file

@ -41,7 +41,7 @@ public class ModelPonyArmor extends ModelPlayerPony {
this.extHead[0].offsetZ = 0f; this.extHead[0].offsetZ = 0f;
this.extHead[1].offsetY = 0f; this.extHead[1].offsetY = 0f;
this.extHead[1].offsetZ = 0f; this.extHead[1].offsetZ = 0f;
this.setLegs(move, swing, tick); this.setLegs(move, swing, tick, entity);
this.holdItem(); this.holdItem();
this.swingItem(entity, this.swingProgress); this.swingItem(entity, this.swingProgress);
if (this.isSneak && !this.isFlying) { if (this.isSneak && !this.isFlying) {
@ -198,6 +198,7 @@ public class ModelPonyArmor extends ModelPlayerPony {
this.bipedLeftLeg.mirror = true; this.bipedLeftLeg.mirror = true;
this.steveRightArm = new ModelRenderer(this, 0, 16); this.steveRightArm = new ModelRenderer(this, 0, 16);
this.unicornArmRight = 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[0] = new ModelRenderer(this, 48, 8);
this.extLegs[1] = new ModelRenderer(this, 48, 8); this.extLegs[1] = new ModelRenderer(this, 48, 8);
this.extLegs[1].mirror = true; this.extLegs[1].mirror = true;
@ -272,8 +273,8 @@ public class ModelPonyArmor extends ModelPlayerPony {
} }
@Override @Override
protected void rotateLegs(float move, float swing, float tick) { protected void rotateLegs(float move, float swing, float tick, Entity entity) {
super.rotateLegs(move, swing, tick); super.rotateLegs(move, swing, tick, entity);
this.syncLegs(); this.syncLegs();
} }

View file

@ -1,18 +1,20 @@
package com.brohoof.minelittlepony.model.pony.armor; package com.brohoof.minelittlepony.model.pony.armor;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
public class ModelSkeletonPonyArmor extends ModelPonyArmor { public class ModelSkeletonPonyArmor extends ModelPonyArmor {
@Override @Override
protected void rotateLegs(float move, float swing, float tick) { protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX; float rightArmRotateAngleX;
float leftArmRotateAngleX; float leftArmRotateAngleX;
float rightLegRotateAngleX; float rightLegRotateAngleX;
float leftLegRotateAngleX; float leftLegRotateAngleX;
float var8; float var8;
float var9; 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) { if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270; rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270;

View file

@ -1,18 +1,20 @@
package com.brohoof.minelittlepony.model.pony.armor; package com.brohoof.minelittlepony.model.pony.armor;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
public class ModelZombiePonyArmor extends ModelPonyArmor { public class ModelZombiePonyArmor extends ModelPonyArmor {
@Override @Override
protected void rotateLegs(float move, float swing, float tick) { protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX; float rightArmRotateAngleX;
float leftArmRotateAngleX; float leftArmRotateAngleX;
float rightLegRotateAngleX; float rightLegRotateAngleX;
float leftLegRotateAngleX; float leftLegRotateAngleX;
float var8; float var8;
float var9; 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) { if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270; rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270; leftArmRotateAngleX = ROTATE_270;