2018-04-25 16:40:47 +02:00
|
|
|
package com.minelittlepony.model.ponies;
|
2016-11-24 08:01:23 +01:00
|
|
|
|
|
|
|
import net.minecraft.client.model.ModelRenderer;
|
|
|
|
import net.minecraft.entity.Entity;
|
2017-06-13 05:55:50 +02:00
|
|
|
import net.minecraft.entity.monster.AbstractIllager;
|
2016-11-24 08:01:23 +01:00
|
|
|
import net.minecraft.util.EnumHandSide;
|
|
|
|
import net.minecraft.util.math.MathHelper;
|
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
public class ModelIllagerPony extends ModelPlayerPony {
|
2016-11-24 08:01:23 +01:00
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
public ModelIllagerPony() {
|
|
|
|
super(false);
|
2016-11-24 08:01:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-06-13 05:55:50 +02:00
|
|
|
public void setRotationAngles(float swing, float move, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
|
|
|
|
|
|
|
super.setRotationAngles(swing, move, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
|
|
|
AbstractIllager illager = (AbstractIllager) entityIn;
|
2017-06-16 07:35:02 +02:00
|
|
|
AbstractIllager.IllagerArmPose pose = illager.getArmPose();
|
2017-06-13 05:55:50 +02:00
|
|
|
|
|
|
|
boolean rightHanded = illager.getPrimaryHand() == EnumHandSide.RIGHT;
|
|
|
|
|
|
|
|
if (pose == AbstractIllager.IllagerArmPose.ATTACKING) {
|
|
|
|
// vindicator attacking
|
|
|
|
float f = MathHelper.sin(this.swingProgress * (float) Math.PI);
|
|
|
|
float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float) Math.PI);
|
|
|
|
this.bipedRightArm.rotateAngleZ = 0.0F;
|
|
|
|
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
|
|
|
this.bipedRightArm.rotateAngleY = 0.15707964F;
|
|
|
|
this.bipedLeftArm.rotateAngleY = -0.15707964F;
|
|
|
|
|
|
|
|
if (rightHanded) {
|
|
|
|
this.bipedRightArm.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
|
|
|
|
this.bipedRightArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
|
|
|
} else {
|
|
|
|
this.bipedLeftArm.rotateAngleX = -1.8849558F + MathHelper.cos(ageInTicks * 0.09F) * 0.15F;
|
|
|
|
this.bipedLeftArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
|
|
|
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
|
|
|
|
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
|
|
|
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
|
|
|
|
} else if (pose == AbstractIllager.IllagerArmPose.SPELLCASTING) {
|
|
|
|
if (this.metadata.hasMagic()) {
|
|
|
|
this.horn.setUsingMagic(true);
|
|
|
|
}
|
|
|
|
// waving arms!
|
|
|
|
if (rightHanded) {
|
|
|
|
// this.bipedRightArm.rotationPointZ = 0.0F;
|
|
|
|
// this.bipedRightArm.rotationPointX = -5.0F;
|
|
|
|
this.bipedRightArm.rotateAngleX = (float) (-.75F * Math.PI);
|
2018-04-26 23:53:49 +02:00
|
|
|
this.bipedRightArm.rotateAngleZ = MathHelper.cos(ageInTicks * 0.6662F) / 4;
|
2017-06-13 05:55:50 +02:00
|
|
|
this.bipedRightArm.rotateAngleY = 1.1F;
|
|
|
|
} else {
|
|
|
|
// this.bipedLeftArm.rotationPointZ = 0.0F;
|
|
|
|
// this.bipedLeftArm.rotationPointX = 5.0F;
|
|
|
|
this.bipedLeftArm.rotateAngleX = (float) (-.75F * Math.PI);
|
2018-04-26 23:53:49 +02:00
|
|
|
this.bipedLeftArm.rotateAngleZ = -MathHelper.cos(ageInTicks * 0.6662F) / 4;
|
2017-06-13 05:55:50 +02:00
|
|
|
this.bipedLeftArm.rotateAngleY = -1.1F;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (pose == AbstractIllager.IllagerArmPose.BOW_AND_ARROW) {
|
|
|
|
if (rightHanded) {
|
|
|
|
aimBow(ArmPose.EMPTY, ArmPose.BOW_AND_ARROW, ageInTicks);
|
|
|
|
} else {
|
|
|
|
aimBow(ArmPose.BOW_AND_ARROW, ArmPose.EMPTY, ageInTicks);
|
|
|
|
}
|
2016-11-24 08:01:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-13 11:09:55 +02:00
|
|
|
public ModelRenderer getArm(EnumHandSide side) {
|
|
|
|
return metadata.hasMagic() ? side == EnumHandSide.LEFT ? this.unicornArmLeft : this.unicornArmRight : this.getArmForSide(side);
|
2016-11-24 08:01:23 +01:00
|
|
|
}
|
|
|
|
}
|