diff --git a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java index c9cea49a..da19d70b 100644 --- a/src/main/java/com/minelittlepony/model/AbstractPonyModel.java +++ b/src/main/java/com/minelittlepony/model/AbstractPonyModel.java @@ -1,6 +1,7 @@ package com.minelittlepony.model; import com.minelittlepony.model.armour.PonyArmor; +import com.minelittlepony.model.capabilities.IModel; import com.minelittlepony.pony.data.IPonyData; import com.minelittlepony.pony.data.PonyData; import com.minelittlepony.pony.data.PonySize; @@ -20,7 +21,7 @@ import static net.minecraft.client.renderer.GlStateManager.*; /** * TODO: move this into constructor and make separate classes for the races. */ -public abstract class AbstractPonyModel extends ModelPlayer { +public abstract class AbstractPonyModel extends ModelPlayer implements IModel { /** * The model's current scale. @@ -78,9 +79,7 @@ public abstract class AbstractPonyModel extends ModelPlayer { return side == EnumHandSide.RIGHT ? rightArmPose : leftArmPose; } - /** - * Returns true if this model is on the ground and crouching. - */ + @Override public boolean isCrouching() { return isSneak && !isFlying; } @@ -92,21 +91,27 @@ public abstract class AbstractPonyModel extends ModelPlayer { rainboom = isFlying(entity) && swing >= 0.9999F; } - /** - * Returns true if the given entity can and is flying, or has an elytra. - */ + @Override public boolean isFlying(Entity entity) { return (isFlying && metadata.getRace().hasWings()) || (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()); } - /** - * Returns true if the current model is a child or a child-like foal. - */ + @Override + public boolean isFlying() { + return isFlying; + } + + @Override public boolean isChild() { return metadata.getSize() == PonySize.FOAL || isChild; } + @Override + public float getSwingAmount() { + return swingProgress; + } + /** * Adjusts the rotation center of the given renderer by the given amounts in each direction. */ diff --git a/src/main/java/com/minelittlepony/model/ModelMobPony.java b/src/main/java/com/minelittlepony/model/ModelMobPony.java index dc807eef..8798bfc5 100644 --- a/src/main/java/com/minelittlepony/model/ModelMobPony.java +++ b/src/main/java/com/minelittlepony/model/ModelMobPony.java @@ -38,11 +38,11 @@ public class ModelMobPony extends ModelAlicorn { protected void rotateRightArm(float move, float tick) { if (rightArmPose == ArmPose.EMPTY) return; - if (!metadata.hasMagic()) { - rotateArmHolding(bipedRightArm, -1, swingProgress, tick); - } else { + if (canCast()) { unicornArmRight.setRotationPoint(-7, 12, -2); rotateArmHolding(unicornArmRight, -1, swingProgress, tick); + } else { + rotateArmHolding(bipedRightArm, -1, swingProgress, tick); } } @@ -55,11 +55,11 @@ public class ModelMobPony extends ModelAlicorn { protected void rotateLeftArm(float move, float tick) { if (leftArmPose == ArmPose.EMPTY) return; - if (!metadata.hasMagic()) { - rotateArmHolding(bipedLeftArm, -1, swingProgress, tick); - } else { + if (!canCast()) { unicornArmRight.setRotationPoint(-7, 12, -2); rotateArmHolding(unicornArmLeft, -1, swingProgress, tick); + } else { + rotateArmHolding(bipedLeftArm, -1, swingProgress, tick); } } } diff --git a/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java b/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java index 2802fc9d..fe44b19f 100644 --- a/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java +++ b/src/main/java/com/minelittlepony/model/armour/ModelPonyArmor.java @@ -1,6 +1,5 @@ package com.minelittlepony.model.armour; -import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import static com.minelittlepony.model.PonyModelConstants.*; @@ -23,9 +22,15 @@ public class ModelPonyArmor extends ModelMobPony { textureHeight = 32; } + @Override + public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) { + super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity); + syncLegs(); + } + @Override protected void rotateLook(float limbSwing, float limbSwingAmount, float bodySwing, float ticks) { - bipedBody.rotateAngleY = bodySwing * 0.2F; + bipedBody.rotateAngleY = bodySwing / 5; } @Override @@ -104,8 +109,8 @@ public class ModelPonyArmor extends ModelMobPony { @Override protected void initHeadTextures() { - bipedHead = new ModelRenderer(this, 0, 0); - bipedHeadwear = new ModelRenderer(this, 32, 0); + bipedHead = new PonyRenderer(this, 0, 0); + bipedHeadwear = new PonyRenderer(this, 32, 0); helmet = new PonyRenderer(this, 0, 0); } @@ -119,7 +124,7 @@ public class ModelPonyArmor extends ModelMobPony { @Override protected void initLegTextures() { bipedRightArm = new PonyRenderer(this, 0, 16); - bipedRightLeg = new ModelRenderer(this, 0, 16); + bipedRightLeg = new PonyRenderer(this, 0, 16); bipedLeftArm = new PonyRenderer(this, 0, 16).mirror(); bipedLeftLeg = new PonyRenderer(this, 0, 16).mirror(); @@ -178,24 +183,6 @@ public class ModelPonyArmor extends ModelMobPony { leftLegging.rotateAt(bipedLeftLeg).rotateTo(bipedLeftLeg); } - @Override - protected void setLegs(float move, float swing, float tick, Entity entity) { - super.setLegs(move, swing, tick, entity); - syncLegs(); - } - - @Override - protected void sneakLegs() { - super.sneakLegs(); - syncLegs(); - } - - @Override - protected void ponySleep() { - super.ponySleep(); - syncLegs(); - } - @Override public void setVisible(boolean invisible) { super.setVisible(invisible); diff --git a/src/main/java/com/minelittlepony/model/armour/ModelSkeletonPonyArmor.java b/src/main/java/com/minelittlepony/model/armour/ModelSkeletonPonyArmor.java index 08e3b167..a2229dff 100644 --- a/src/main/java/com/minelittlepony/model/armour/ModelSkeletonPonyArmor.java +++ b/src/main/java/com/minelittlepony/model/armour/ModelSkeletonPonyArmor.java @@ -6,15 +6,9 @@ package com.minelittlepony.model.armour; */ public class ModelSkeletonPonyArmor extends ModelPonyArmor { - @Override - protected void adjustLegs(float move, float swing, float tick) { - aimBow(leftArmPose, rightArmPose, tick); - super.adjustLegs(move, swing, tick); - } - @Override protected void fixSpecialRotationPoints(float move) { - if (rightArmPose != ArmPose.EMPTY && !metadata.hasMagic()) { + if (rightArmPose != ArmPose.EMPTY && !canCast()) { bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4); } } diff --git a/src/main/java/com/minelittlepony/model/capabilities/IModel.java b/src/main/java/com/minelittlepony/model/capabilities/IModel.java new file mode 100644 index 00000000..f1bfe006 --- /dev/null +++ b/src/main/java/com/minelittlepony/model/capabilities/IModel.java @@ -0,0 +1,28 @@ +package com.minelittlepony.model.capabilities; + +import net.minecraft.entity.Entity; + +public interface IModel { + + /** + * Returns true if this model is on the ground and crouching. + */ + boolean isCrouching(); + + /** + * Returns true if the given entity can and is flying, or has an elytra. + */ + boolean isFlying(Entity entity); + + /** + * Returns true if the model is flying. + */ + boolean isFlying(); + + /** + * Returns true if the current model is a child or a child-like foal. + */ + boolean isChild(); + + float getSwingAmount(); +} diff --git a/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java b/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java index b84ec9e7..c2edccdb 100644 --- a/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java +++ b/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java @@ -1,5 +1,13 @@ package com.minelittlepony.model.capabilities; -public interface IModelPegasus { +public interface IModelPegasus extends IModel { + /** + * Returns true if the wings are spread. + */ + boolean wingsAreOpen(); + /** + * Returns true if this model is being applied to a race that has wings. + */ + boolean canFly(); } diff --git a/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java b/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java index a1f16559..234003b9 100644 --- a/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java +++ b/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java @@ -4,8 +4,17 @@ import com.minelittlepony.render.PonyRenderer; import net.minecraft.util.EnumHandSide; -public interface IModelUnicorn { +public interface IModelUnicorn extends IModel { PonyRenderer getUnicornArmForSide(EnumHandSide side); + /** + * Returns true if this model is being applied to a race that can use magic. + */ + boolean canCast(); + + /** + * Returns true if this model is currently using magic (horn is lit). + * @return + */ boolean isCasting(); } diff --git a/src/main/java/com/minelittlepony/model/components/PegasusWings.java b/src/main/java/com/minelittlepony/model/components/PegasusWings.java index e492137e..9846c2bd 100644 --- a/src/main/java/com/minelittlepony/model/components/PegasusWings.java +++ b/src/main/java/com/minelittlepony/model/components/PegasusWings.java @@ -1,35 +1,32 @@ package com.minelittlepony.model.components; -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; import net.minecraft.util.math.MathHelper; import static com.minelittlepony.model.PonyModelConstants.*; import com.minelittlepony.model.AbstractPonyModel; +import com.minelittlepony.model.capabilities.IModelPegasus; -public class PegasusWings extends ModelBase { +public class PegasusWings { - private final AbstractPonyModel pony; + private final IModelPegasus pegasus; public final ModelWing leftWing; public final ModelWing rightWing; - public PegasusWings(AbstractPonyModel model, float yOffset, float stretch) { - pony = model; + public PegasusWings(T model, float yOffset, float stretch) { + pegasus = model; - leftWing = new ModelWing(pony, false, 4f, yOffset, stretch, 32); - rightWing = new ModelWing(pony, true, -6f, yOffset, stretch, 16); + leftWing = new ModelWing(model, false, 4f, yOffset, stretch, 32); + rightWing = new ModelWing(model, true, -6f, yOffset, stretch, 16); } - @Override - public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) { - if (!isVisible()) return; - + public void setRotationAngles(float move, float swing, float ticks) { float flap = 0; + float progress = pegasus.getSwingAmount(); - if (pony.swingProgress > 0) { - flap = MathHelper.sin(MathHelper.sqrt(pony.swingProgress) * PI * 2); + if (progress > 0) { + flap = MathHelper.sin(MathHelper.sqrt(progress) * PI * 2); } else { float pi = PI * (float) Math.pow(swing, 16); @@ -42,7 +39,7 @@ public class PegasusWings extends ModelBase { leftWing.rotateWalking(flap); rightWing.rotateWalking(-flap); - if (isExtended()) { + if (pegasus.wingsAreOpen()) { float flapAngle = getWingRotationFactor(ticks); leftWing.rotateFlying(flapAngle); rightWing.rotateFlying(-flapAngle); @@ -51,24 +48,14 @@ public class PegasusWings extends ModelBase { } public float getWingRotationFactor(float ticks) { - if (pony.isFlying) { + if (pegasus.isFlying()) { return (MathHelper.sin(ticks * 0.536f) * 1) + ROTATE_270 + 0.4f; } return LEFT_WING_ROTATE_ANGLE_Z_SNEAK; } - public boolean isVisible() { - return pony.metadata.getRace().hasWings(); - } - - public boolean isExtended() { - return pony.isFlying || pony.isCrouching(); - } - - @Override - public void render(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) { - if (!isVisible()) return; - boolean standing = isExtended(); + public void render(float scale) { + boolean standing = pegasus.wingsAreOpen(); leftWing.render(standing, scale); rightWing.render(standing, scale); } diff --git a/src/main/java/com/minelittlepony/model/components/UnicornHorn.java b/src/main/java/com/minelittlepony/model/components/UnicornHorn.java index c8d8d147..9306c1dc 100644 --- a/src/main/java/com/minelittlepony/model/components/UnicornHorn.java +++ b/src/main/java/com/minelittlepony/model/components/UnicornHorn.java @@ -4,25 +4,16 @@ import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.render.HornGlowRenderer; import com.minelittlepony.render.PonyRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; - import static org.lwjgl.opengl.GL11.*; import static net.minecraft.client.renderer.GlStateManager.*; import static com.minelittlepony.model.PonyModelConstants.*; -public class UnicornHorn extends ModelBase { - - protected final AbstractPonyModel pony; +public class UnicornHorn { private PonyRenderer horn; private HornGlowRenderer glow; - private boolean usingMagic; - public UnicornHorn(AbstractPonyModel pony, float yOffset, float stretch) { - this.pony = pony; - horn = new PonyRenderer(pony, 0, 3); glow = new HornGlowRenderer(pony, 0, 3); @@ -37,18 +28,11 @@ public class UnicornHorn extends ModelBase { .setAlpha(0.2f).box(0, 0, 0, 1, 3, 1, stretch + 0.8F); } - @Override - public void render(Entity entityIn, float move, float swing, float age, float headYaw, float headPitch, float scale) { - if (!pony.metadata.getRace().hasHorn()) return; - + public void render(float scale) { horn.render(scale); - - if (usingMagic && pony.metadata.hasMagic()) { - renderMagic(pony.metadata.getGlowColor(), scale); - } } - private void renderMagic(int tint, float scale) { + public void renderMagic(int tint, float scale) { glPushAttrib(24577); disableTexture2D(); disableLighting(); @@ -63,8 +47,4 @@ public class UnicornHorn extends ModelBase { disableBlend(); popAttrib(); } - - public void setUsingMagic(boolean usingMagic) { - this.usingMagic = usingMagic; - } } diff --git a/src/main/java/com/minelittlepony/model/player/ModelAlicorn.java b/src/main/java/com/minelittlepony/model/player/ModelAlicorn.java index 3a66c916..f6fbceb4 100644 --- a/src/main/java/com/minelittlepony/model/player/ModelAlicorn.java +++ b/src/main/java/com/minelittlepony/model/player/ModelAlicorn.java @@ -51,7 +51,7 @@ public class ModelAlicorn extends ModelPegasus implements IModelUnicorn { @Override protected void holdItem(float swing) { - if (metadata.hasMagic()) { + if (canCast()) { boolean both = leftArmPose == ArmPose.ITEM && rightArmPose == ArmPose.ITEM; alignArmForAction(unicornArmLeft, leftArmPose, both, swing); @@ -59,13 +59,11 @@ public class ModelAlicorn extends ModelPegasus implements IModelUnicorn { } else { super.holdItem(swing); } - - horn.setUsingMagic(leftArmPose != ArmPose.EMPTY || rightArmPose != ArmPose.EMPTY); } @Override protected void swingItem(Entity entity, float swingProgress) { - if (metadata.hasMagic()) { + if (canCast()) { if (swingProgress > -9990.0F && !isSleeping) { EnumHandSide mainSide = getMainHand(entity); @@ -81,9 +79,7 @@ public class ModelAlicorn extends ModelPegasus implements IModelUnicorn { protected void swingArms(float tick) { if (isSleeping) return; - if (!metadata.hasMagic()) { - super.swingArms(tick); - } else { + if (canCast()) { float cos = MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F; float sin = MathHelper.sin(tick * 0.067F) * 0.05F; @@ -96,6 +92,8 @@ public class ModelAlicorn extends ModelPegasus implements IModelUnicorn { unicornArmLeft.rotateAngleZ += cos; unicornArmLeft.rotateAngleX += sin; } + } else { + super.swingArms(tick); } } @@ -105,10 +103,15 @@ public class ModelAlicorn extends ModelPegasus implements IModelUnicorn { } @Override - public boolean isCasting() { + public boolean canCast() { return metadata.hasMagic(); } + @Override + public boolean isCasting() { + return rightArmPose != ArmPose.EMPTY || leftArmPose != ArmPose.EMPTY; + } + @Override protected void sneakLegs() { super.sneakLegs(); @@ -118,18 +121,24 @@ public class ModelAlicorn extends ModelPegasus implements IModelUnicorn { @Override protected void aimBow(ArmPose leftArm, ArmPose rightArm, float tick) { - if (!metadata.hasMagic()) { - super.aimBow(leftArm, rightArm, tick); - } else if (leftArm == ArmPose.BOW_AND_ARROW || rightArm == ArmPose.BOW_AND_ARROW) { + if (canCast()) { if (rightArm == ArmPose.BOW_AND_ARROW) aimBowPony(unicornArmRight, tick, true); if (leftArm == ArmPose.BOW_AND_ARROW) aimBowPony(unicornArmLeft, tick, false); + } else { + super.aimBow(leftArm, rightArm, tick); } } @Override protected void renderHead(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) { super.renderHead(entity, move, swing, age, headYaw, headPitch, scale); - horn.render(entity, move, swing, age, headYaw, headPitch, scale); + + if (canCast()) { + horn.render(scale); + if (isCasting()) { + horn.renderMagic(metadata.getGlowColor(), scale); + } + } } @Override diff --git a/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java b/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java index f2b9ec65..dbf83658 100644 --- a/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java +++ b/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java @@ -272,7 +272,7 @@ public class ModelEarthPony extends AbstractPonyModel { if (!isFlying && both) { swag -= (float)Math.pow(swing, 2); } - float mult = 1 - swag/2f; + float mult = 1 - swag/2; arm.rotateAngleX = bipedLeftArm.rotateAngleX * mult - (PI / 10) * swag; case EMPTY: arm.rotateAngleY = 0; @@ -373,10 +373,8 @@ public class ModelEarthPony extends AbstractPonyModel { } protected void aimBow(ArmPose leftArm, ArmPose rightArm, float tick) { - if (leftArm == ArmPose.BOW_AND_ARROW || rightArm == ArmPose.BOW_AND_ARROW) { - if (rightArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedRightArm, tick, false); - if (leftArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedLeftArm, tick, false); - } + if (rightArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedRightArm, tick, false); + if (leftArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedLeftArm, tick, false); } protected void aimBowPony(ModelRenderer arm, float tick, boolean shift) { @@ -458,6 +456,10 @@ public class ModelEarthPony extends AbstractPonyModel { initHeadTextures(); initBodyTextures(); initLegTextures(); + initTailTextures(); + } + + protected void initTailTextures() { tail = new PonyTail(this); } diff --git a/src/main/java/com/minelittlepony/model/player/ModelPegasus.java b/src/main/java/com/minelittlepony/model/player/ModelPegasus.java index f4f4cb73..7ad1d836 100644 --- a/src/main/java/com/minelittlepony/model/player/ModelPegasus.java +++ b/src/main/java/com/minelittlepony/model/player/ModelPegasus.java @@ -8,6 +8,7 @@ import static com.minelittlepony.model.PonyModelConstants.*; import com.minelittlepony.model.capabilities.IModelPegasus; public class ModelPegasus extends ModelEarthPony implements IModelPegasus { + public PegasusWings wings; public ModelPegasus(boolean smallArms) { @@ -32,7 +33,7 @@ public class ModelPegasus extends ModelEarthPony implements IModelPegasus { super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity); if (bipedCape != null) { - wings.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity); + wings.setRotationAngles(move, swing, age); } } @@ -58,6 +59,18 @@ public class ModelPegasus extends ModelEarthPony implements IModelPegasus { @Override protected void renderBody(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) { super.renderBody(entity, move, swing, age, headYaw, headPitch, scale); - wings.render(entity, move, swing, age, headYaw, headPitch, scale); + if (canFly()) { + wings.render(scale); + } + } + + @Override + public boolean wingsAreOpen() { + return isFlying || isCrouching(); + } + + @Override + public boolean canFly() { + return metadata.getRace().hasWings(); } } diff --git a/src/main/java/com/minelittlepony/model/ponies/ModelIllagerPony.java b/src/main/java/com/minelittlepony/model/ponies/ModelIllagerPony.java index ea355585..2307d034 100644 --- a/src/main/java/com/minelittlepony/model/ponies/ModelIllagerPony.java +++ b/src/main/java/com/minelittlepony/model/ponies/ModelIllagerPony.java @@ -5,6 +5,7 @@ import com.minelittlepony.model.player.ModelAlicorn; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.monster.AbstractIllager; +import net.minecraft.entity.monster.AbstractIllager.IllagerArmPose; import net.minecraft.util.EnumHandSide; import net.minecraft.util.math.MathHelper; @@ -19,11 +20,11 @@ public class ModelIllagerPony extends ModelAlicorn { super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity); AbstractIllager illager = (AbstractIllager) entity; - AbstractIllager.IllagerArmPose pose = illager.getArmPose(); + IllagerArmPose pose = illager.getArmPose(); boolean rightHanded = illager.getPrimaryHand() == EnumHandSide.RIGHT; - if (pose == AbstractIllager.IllagerArmPose.ATTACKING) { + if (pose == IllagerArmPose.ATTACKING) { // vindicator attacking float f = MathHelper.sin(swingProgress * (float) Math.PI); float f1 = MathHelper.sin((1.0F - (1.0F - swingProgress) * (1.0F - swingProgress)) * (float) Math.PI); @@ -44,10 +45,7 @@ public class ModelIllagerPony extends ModelAlicorn { bipedLeftArm.rotateAngleZ -= MathHelper.cos(age * 0.09F) * 0.05F + 0.05F; bipedRightArm.rotateAngleX += MathHelper.sin(age * 0.067F) * 0.05F; bipedLeftArm.rotateAngleX -= MathHelper.sin(age * 0.067F) * 0.05F; - } else if (pose == AbstractIllager.IllagerArmPose.SPELLCASTING) { - if (metadata.hasMagic()) { - horn.setUsingMagic(true); - } + } else if (pose == IllagerArmPose.SPELLCASTING) { // waving arms! if (rightHanded) { // this.bipedRightArm.rotationPointZ = 0.0F; @@ -63,7 +61,7 @@ public class ModelIllagerPony extends ModelAlicorn { bipedLeftArm.rotateAngleY = -1.1F; } - } else if (pose == AbstractIllager.IllagerArmPose.BOW_AND_ARROW) { + } else if (pose == IllagerArmPose.BOW_AND_ARROW) { if (rightHanded) { aimBow(ArmPose.EMPTY, ArmPose.BOW_AND_ARROW, age); } else { @@ -73,6 +71,6 @@ public class ModelIllagerPony extends ModelAlicorn { } public ModelRenderer getArm(EnumHandSide side) { - return metadata.hasMagic() ? getUnicornArmForSide(side) : getArmForSide(side); + return canCast() ? getUnicornArmForSide(side) : getArmForSide(side); } } diff --git a/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java b/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java index eecef93d..e74010a8 100644 --- a/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java +++ b/src/main/java/com/minelittlepony/model/ponies/ModelSkeletonPony.java @@ -6,7 +6,6 @@ import com.minelittlepony.model.ModelMobPony; import com.minelittlepony.model.armour.ModelSkeletonPonyArmor; import com.minelittlepony.model.armour.PonyArmor; -import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.AbstractSkeleton; @@ -17,10 +16,6 @@ import net.minecraft.util.EnumHandSide; public class ModelSkeletonPony extends ModelMobPony { - public ModelSkeletonPony() { - super(); - } - @Override public PonyArmor createArmour() { return new PonyArmor(new ModelSkeletonPonyArmor(), new ModelSkeletonPonyArmor()); @@ -28,31 +23,25 @@ public class ModelSkeletonPony extends ModelMobPony { @Override public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) { - rightArmPose = ModelBiped.ArmPose.EMPTY; - leftArmPose = ModelBiped.ArmPose.EMPTY; + rightArmPose = ArmPose.EMPTY; + leftArmPose = ArmPose.EMPTY; ItemStack itemstack = entity.getHeldItem(EnumHand.MAIN_HAND); if (itemstack.getItem() == Items.BOW && ((AbstractSkeleton)entity).isSwingingArms()) { if (entity.getPrimaryHand() == EnumHandSide.RIGHT) { - rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW; + rightArmPose = ArmPose.BOW_AND_ARROW; } else { - leftArmPose = ModelBiped.ArmPose.BOW_AND_ARROW; + leftArmPose = ArmPose.BOW_AND_ARROW; } } super.setLivingAnimations(entity, move, swing, ticks); } - @Override - protected void adjustLegs(float move, float swing, float ticks) { - super.adjustLegs(move, swing, ticks); - aimBow(leftArmPose, rightArmPose, ticks); - } - @Override protected void fixSpecialRotationPoints(float move) { - if (rightArmPose != ArmPose.EMPTY && !metadata.hasMagic()) { + if (rightArmPose != ArmPose.EMPTY && !canCast()) { bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4); } } diff --git a/src/main/java/com/minelittlepony/model/ponies/ModelVillagerPony.java b/src/main/java/com/minelittlepony/model/ponies/ModelVillagerPony.java index 119a1313..d213c682 100644 --- a/src/main/java/com/minelittlepony/model/ponies/ModelVillagerPony.java +++ b/src/main/java/com/minelittlepony/model/ponies/ModelVillagerPony.java @@ -21,7 +21,7 @@ public class ModelVillagerPony extends ModelAlicorn { super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity); float angleY = 0; - if (swingProgress > -9990.0F && !metadata.hasMagic()) { + if (swingProgress > -9990.0F && !canCast()) { angleY = MathHelper.sin(MathHelper.sqrt(swingProgress) * PI * 2) * 0.04F; } bag.rotateAngleY = angleY; diff --git a/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java b/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java index b3f7bb69..e71c2bfe 100644 --- a/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java +++ b/src/main/java/com/minelittlepony/model/ponies/ModelZombiePony.java @@ -6,10 +6,6 @@ import com.minelittlepony.model.armour.PonyArmor; public class ModelZombiePony extends ModelMobPony { - public ModelZombiePony() { - super(); - } - @Override public PonyArmor createArmour() { return new PonyArmor(new ModelZombiePonyArmor(), new ModelZombiePonyArmor()); diff --git a/src/main/java/com/minelittlepony/render/layer/LayerHeldPonyItemMagical.java b/src/main/java/com/minelittlepony/render/layer/LayerHeldPonyItemMagical.java index 83491c81..e4f1b1da 100644 --- a/src/main/java/com/minelittlepony/render/layer/LayerHeldPonyItemMagical.java +++ b/src/main/java/com/minelittlepony/render/layer/LayerHeldPonyItemMagical.java @@ -30,7 +30,7 @@ public class LayerHeldPonyItemMagical extends LayerH private boolean isUnicorn() { ModelBase model = getMainModel(); - return model instanceof IModelUnicorn && ((IModelUnicorn) model).isCasting(); + return model instanceof IModelUnicorn && ((IModelUnicorn) model).canCast(); } protected void preItemRender(T entity, ItemStack drop, TransformType transform, EnumHandSide hand) {