2018-04-25 16:40:47 +02:00
|
|
|
package com.minelittlepony.model.ponies;
|
2016-11-24 08:01:23 +01:00
|
|
|
|
2018-04-28 16:39:32 +02:00
|
|
|
import com.minelittlepony.model.player.ModelAlicorn;
|
|
|
|
|
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;
|
2018-04-28 18:13:35 +02:00
|
|
|
import net.minecraft.entity.monster.AbstractIllager.IllagerArmPose;
|
2016-11-24 08:01:23 +01:00
|
|
|
import net.minecraft.util.EnumHandSide;
|
|
|
|
import net.minecraft.util.math.MathHelper;
|
|
|
|
|
2018-04-28 16:39:32 +02:00
|
|
|
public class ModelIllagerPony extends ModelAlicorn {
|
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
|
2018-05-01 12:38:13 +02:00
|
|
|
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
|
|
|
super.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);
|
2018-04-28 16:39:32 +02:00
|
|
|
|
2018-04-27 13:49:33 +02:00
|
|
|
AbstractIllager illager = (AbstractIllager) entity;
|
2018-04-28 18:13:35 +02:00
|
|
|
IllagerArmPose pose = illager.getArmPose();
|
2017-06-13 05:55:50 +02:00
|
|
|
|
|
|
|
boolean rightHanded = illager.getPrimaryHand() == EnumHandSide.RIGHT;
|
|
|
|
|
2018-04-28 18:13:35 +02:00
|
|
|
if (pose == IllagerArmPose.ATTACKING) {
|
2017-06-13 05:55:50 +02:00
|
|
|
// vindicator attacking
|
2018-04-27 13:49:33 +02:00
|
|
|
float f = MathHelper.sin(swingProgress * (float) Math.PI);
|
|
|
|
float f1 = MathHelper.sin((1.0F - (1.0F - swingProgress) * (1.0F - swingProgress)) * (float) Math.PI);
|
|
|
|
bipedRightArm.rotateAngleZ = 0.0F;
|
|
|
|
bipedLeftArm.rotateAngleZ = 0.0F;
|
|
|
|
bipedRightArm.rotateAngleY = 0.15707964F;
|
|
|
|
bipedLeftArm.rotateAngleY = -0.15707964F;
|
2017-06-13 05:55:50 +02:00
|
|
|
|
|
|
|
if (rightHanded) {
|
2018-05-01 12:38:13 +02:00
|
|
|
bipedRightArm.rotateAngleX = -1.8849558F + MathHelper.cos(ticks * 0.09F) * 0.15F;
|
2018-04-27 13:49:33 +02:00
|
|
|
bipedRightArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
2017-06-13 05:55:50 +02:00
|
|
|
} else {
|
2018-05-01 12:38:13 +02:00
|
|
|
bipedLeftArm.rotateAngleX = -1.8849558F + MathHelper.cos(ticks * 0.09F) * 0.15F;
|
2018-04-27 13:49:33 +02:00
|
|
|
bipedLeftArm.rotateAngleX += f * 2.2F - f1 * 0.4F;
|
2017-06-13 05:55:50 +02:00
|
|
|
}
|
|
|
|
|
2018-05-01 12:38:13 +02:00
|
|
|
bipedRightArm.rotateAngleZ += MathHelper.cos(ticks * 0.09F) * 0.05F + 0.05F;
|
|
|
|
bipedLeftArm.rotateAngleZ -= MathHelper.cos(ticks * 0.09F) * 0.05F + 0.05F;
|
|
|
|
bipedRightArm.rotateAngleX += MathHelper.sin(ticks * 0.067F) * 0.05F;
|
|
|
|
bipedLeftArm.rotateAngleX -= MathHelper.sin(ticks * 0.067F) * 0.05F;
|
2018-04-28 18:13:35 +02:00
|
|
|
} else if (pose == IllagerArmPose.SPELLCASTING) {
|
2017-06-13 05:55:50 +02:00
|
|
|
// waving arms!
|
|
|
|
if (rightHanded) {
|
|
|
|
// this.bipedRightArm.rotationPointZ = 0.0F;
|
|
|
|
// this.bipedRightArm.rotationPointX = -5.0F;
|
2018-04-27 13:49:33 +02:00
|
|
|
bipedRightArm.rotateAngleX = (float) (-.75F * Math.PI);
|
2018-05-01 12:38:13 +02:00
|
|
|
bipedRightArm.rotateAngleZ = MathHelper.cos(ticks * 0.6662F) / 4;
|
2018-04-27 13:49:33 +02:00
|
|
|
bipedRightArm.rotateAngleY = 1.1F;
|
2017-06-13 05:55:50 +02:00
|
|
|
} else {
|
|
|
|
// this.bipedLeftArm.rotationPointZ = 0.0F;
|
|
|
|
// this.bipedLeftArm.rotationPointX = 5.0F;
|
2018-04-27 13:49:33 +02:00
|
|
|
bipedLeftArm.rotateAngleX = (float) (-.75F * Math.PI);
|
2018-05-01 12:38:13 +02:00
|
|
|
bipedLeftArm.rotateAngleZ = -MathHelper.cos(ticks * 0.6662F) / 4;
|
2018-04-27 13:49:33 +02:00
|
|
|
bipedLeftArm.rotateAngleY = -1.1F;
|
2017-06-13 05:55:50 +02:00
|
|
|
}
|
|
|
|
|
2018-04-28 18:13:35 +02:00
|
|
|
} else if (pose == IllagerArmPose.BOW_AND_ARROW) {
|
2017-06-13 05:55:50 +02:00
|
|
|
if (rightHanded) {
|
2018-05-01 12:38:13 +02:00
|
|
|
aimBow(ArmPose.EMPTY, ArmPose.BOW_AND_ARROW, ticks);
|
2017-06-13 05:55:50 +02:00
|
|
|
} else {
|
2018-05-01 12:38:13 +02:00
|
|
|
aimBow(ArmPose.BOW_AND_ARROW, ArmPose.EMPTY, ticks);
|
2017-06-13 05:55:50 +02:00
|
|
|
}
|
2016-11-24 08:01:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-13 11:09:55 +02:00
|
|
|
public ModelRenderer getArm(EnumHandSide side) {
|
2018-04-28 18:13:35 +02:00
|
|
|
return canCast() ? getUnicornArmForSide(side) : getArmForSide(side);
|
2016-11-24 08:01:23 +01:00
|
|
|
}
|
|
|
|
}
|