From 63a6ea9dc555837558b54a68d11a0d12fd979e3b Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Fri, 4 Mar 2016 23:54:50 -0500 Subject: [PATCH] Remove AniParams. --- .../model/AbstractPonyModel.java | 8 +++---- .../model/part/AbstractHeadPart.java | 5 ++-- .../minelittlepony/model/part/IPonyPart.java | 3 +-- .../model/part/PegasusWings.java | 5 ++-- .../model/pony/ModelPlayerPony.java | 23 +++++++++---------- .../model/pony/ModelVillagerPony.java | 5 ++-- .../model/pony/armor/ModelPonyArmor.java | 13 +++++------ .../minelittlepony/renderer/AniParams.java | 18 --------------- 8 files changed, 27 insertions(+), 53 deletions(-) delete mode 100644 src/main/java/com/brohoof/minelittlepony/renderer/AniParams.java diff --git a/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java b/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java index a99de8f3..52e5e62c 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java +++ b/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java @@ -10,7 +10,6 @@ import com.brohoof.minelittlepony.PonyData; import com.brohoof.minelittlepony.PonySize; import com.brohoof.minelittlepony.model.part.IPonyPart; import com.brohoof.minelittlepony.model.pony.ModelPlayerPony; -import com.brohoof.minelittlepony.renderer.AniParams; import com.brohoof.minelittlepony.renderer.PlaneRenderer; import com.google.common.collect.Lists; @@ -62,7 +61,7 @@ public abstract class AbstractPonyModel extends ModelPlayer { protected void initPositions(float yOffset, float stretch) {} - protected void animate(AniParams var1) {} + protected void animate(float move, float swing, float tick, float horz, float vert) {} protected void render() {} @@ -104,10 +103,9 @@ public abstract class AbstractPonyModel extends ModelPlayer { super.setRotationAngles(Move, Moveswing, Loop, Right, Down, Scale, entityIn); return; } - AniParams ani = new AniParams(Move, Moveswing, Loop, Right, Down); - this.animate(ani); + this.animate(Move, Moveswing, Loop, Right, Down); for (IPonyPart part : modelParts) { - part.animate(metadata, ani); + part.animate(metadata, Move, Moveswing, Loop, Right, Down); } this.steveRightArm.rotateAngleX = MathHelper.cos(Move * 0.6662F + (float) Math.PI) * 2.0F * Moveswing * 0.5F; this.steveRightArm.rotateAngleY = 0; 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 c8b4162d..916db634 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/AbstractHeadPart.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/AbstractHeadPart.java @@ -3,7 +3,6 @@ package com.brohoof.minelittlepony.model.part; import com.brohoof.minelittlepony.PonyData; import com.brohoof.minelittlepony.model.BodyPart; import com.brohoof.minelittlepony.model.AbstractPonyModel; -import com.brohoof.minelittlepony.renderer.AniParams; import net.minecraft.client.renderer.GlStateManager; @@ -23,8 +22,8 @@ public abstract class AbstractHeadPart implements IPonyPart { } @Override - public final void animate(PonyData data, AniParams ani) { - rotateHead(ani.horz, ani.vert); + public final void animate(PonyData data, float move, float swing, float tick, float horz, float vert) { + rotateHead(horz, vert); if (pony.isSneak && !pony.isFlying) { position(0, 6, -2); } else { diff --git a/src/main/java/com/brohoof/minelittlepony/model/part/IPonyPart.java b/src/main/java/com/brohoof/minelittlepony/model/part/IPonyPart.java index c2cfb128..9cbf1b82 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/IPonyPart.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/IPonyPart.java @@ -2,13 +2,12 @@ package com.brohoof.minelittlepony.model.part; import com.brohoof.minelittlepony.PonyData; import com.brohoof.minelittlepony.model.AbstractPonyModel; -import com.brohoof.minelittlepony.renderer.AniParams; public interface IPonyPart { void init(AbstractPonyModel pony, float yOffset, float stretch); - void animate(PonyData data, AniParams ani); + void animate(PonyData metadata, float move, float moveswing, float loop, float right, float down); void render(PonyData data, float scale); 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 50dca3da..ca59fb67 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/part/PegasusWings.java +++ b/src/main/java/com/brohoof/minelittlepony/model/part/PegasusWings.java @@ -4,7 +4,6 @@ import com.brohoof.minelittlepony.PonyData; import com.brohoof.minelittlepony.model.AbstractPonyModel; import com.brohoof.minelittlepony.model.BodyPart; import com.brohoof.minelittlepony.model.PonyModelConstants; -import com.brohoof.minelittlepony.renderer.AniParams; import net.minecraft.client.model.ModelRenderer; import net.minecraft.util.MathHelper; @@ -90,7 +89,7 @@ public class PegasusWings implements IPonyPart, PonyModelConstants { } @Override - public void animate(PonyData metadata, AniParams ani) { + public void animate(PonyData metadata, float move, float swing, float tick, float horz, float vert) { float bodySwingRotation = 0.0F; if (pony.swingProgress > -9990.0F && (!metadata.getRace().hasHorn() || metadata.getGlowColor() == 0)) { @@ -105,7 +104,7 @@ public class PegasusWings implements IPonyPart, PonyModelConstants { if (pony.isSneak && !pony.isFlying) { this.sneak(); } else { - this.unsneak(ani.tick); + this.unsneak(tick); } 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 de0c8c9f..d967b27f 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java @@ -10,7 +10,6 @@ import com.brohoof.minelittlepony.model.part.PegasusWings; import com.brohoof.minelittlepony.model.part.PonyEars; import com.brohoof.minelittlepony.model.part.PonySnout; import com.brohoof.minelittlepony.model.part.UnicornHorn; -import com.brohoof.minelittlepony.renderer.AniParams; import com.brohoof.minelittlepony.renderer.PlaneRenderer; import net.minecraft.client.model.ModelRenderer; @@ -42,10 +41,10 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst } @Override - public void animate(AniParams aniparams) { - this.checkRainboom(aniparams.swing); - this.rotateHead(aniparams.horz, aniparams.vert); - this.swingTailZ(aniparams.move, aniparams.swing); + public void animate(float move, float swing, float tick, float horz, float vert) { + this.checkRainboom(swing); + this.rotateHead(horz, vert); + this.swingTailZ(move, swing); float bodySwingRotation = 0.0F; if (this.swingProgress > -9990.0F && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) { bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F; @@ -75,7 +74,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.bipedHead.offsetZ = 0f; this.bipedHeadwear.offsetY = 0f; this.bipedHeadwear.offsetZ = 0f; - this.setLegs(aniparams.move, aniparams.swing, aniparams.tick); + this.setLegs(move, swing, tick); this.holdItem(); this.swingItem(this.swingProgress); if (this.isSneak && !this.isFlying) { @@ -112,20 +111,20 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.bipedRightLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK; this.bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK; - this.swingArms(aniparams.tick); + this.swingArms(tick); this.setHead(0.0F, 0.0F, 0.0F); for (k1 = 0; k1 < tailstop; ++k1) { setRotationPoint(this.Tail[k1], TAIL_RP_X, TAIL_RP_Y, TAIL_RP_Z_NOTSNEAK); if (this.rainboom) { - this.Tail[k1].rotateAngleX = ROTATE_90 + 0.1F * MathHelper.sin(aniparams.move); + this.Tail[k1].rotateAngleX = ROTATE_90 + 0.1F * MathHelper.sin(move); } else { - this.Tail[k1].rotateAngleX = 0.5F * aniparams.swing; + this.Tail[k1].rotateAngleX = 0.5F * swing; } } if (!this.rainboom) { - this.swingTailX(aniparams.tick); + this.swingTailX(tick); } } @@ -142,11 +141,11 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst } if (this.aimedBow) { - this.aimBow(aniparams.tick); + this.aimBow(tick); } this.fixSpecialRotations(); - this.fixSpecialRotationPoints(aniparams.move); + this.fixSpecialRotationPoints(move); animateWears(); 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 b694af80..c96793dc 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java @@ -1,6 +1,5 @@ package com.brohoof.minelittlepony.model.pony; -import com.brohoof.minelittlepony.renderer.AniParams; import com.brohoof.minelittlepony.renderer.PlaneRenderer; import net.minecraft.util.MathHelper; @@ -18,8 +17,8 @@ public class ModelVillagerPony extends ModelPlayerPony { } @Override - public void animate(AniParams aniparams) { - super.animate(aniparams); + public void animate(float move, float swing, float tick, float horz, float vert) { + super.animate(move, swing, tick, horz, vert); float bodySwingRotation = 0.0F; if (this.swingProgress > -9990.0F && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) { bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F; 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 f4720a0e..ec9fa9c8 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 @@ -1,7 +1,6 @@ package com.brohoof.minelittlepony.model.pony.armor; import com.brohoof.minelittlepony.model.pony.ModelPlayerPony; -import com.brohoof.minelittlepony.renderer.AniParams; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelRenderer; @@ -25,9 +24,9 @@ public class ModelPonyArmor extends ModelPlayerPony { } @Override - public void animate(AniParams aniparams) { - this.checkRainboom(aniparams.swing); - this.rotateHead(aniparams.horz, aniparams.vert); + public void animate(float move, float swing, float tick, float horz, float vert) { + this.checkRainboom(swing); + this.rotateHead(horz, vert); float bodySwingRotation = 0.0F; if (this.swingProgress > -9990.0F && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) { bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F; @@ -41,7 +40,7 @@ public class ModelPonyArmor extends ModelPlayerPony { this.extHead[0].offsetZ = 0f; this.extHead[1].offsetY = 0f; this.extHead[1].offsetZ = 0f; - this.setLegs(aniparams.move, aniparams.swing, aniparams.tick); + this.setLegs(move, swing, tick); this.holdItem(); this.swingItem(this.swingProgress); if (this.isSneak && !this.isFlying) { @@ -72,7 +71,7 @@ public class ModelPonyArmor extends ModelPlayerPony { this.bipedRightLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK; this.bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK; - this.swingArms(aniparams.tick); + this.swingArms(tick); this.setHead(0.0F, 0.0F, 0.0F); } @@ -82,7 +81,7 @@ public class ModelPonyArmor extends ModelPlayerPony { } if (this.aimedBow) { - this.aimBow(aniparams.tick); + this.aimBow(tick); } // this.fixSpecialRotationPoints(aniparams.move); diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/AniParams.java b/src/main/java/com/brohoof/minelittlepony/renderer/AniParams.java deleted file mode 100644 index bc16556f..00000000 --- a/src/main/java/com/brohoof/minelittlepony/renderer/AniParams.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.brohoof.minelittlepony.renderer; - -public class AniParams { - - public float move; - public float swing; - public float tick; - public float horz; - public float vert; - - public AniParams(float move, float swing, float tick, float horz, float vert) { - this.move = move; - this.swing = swing; - this.tick = tick; - this.horz = horz; - this.vert = vert; - } -}