Search in sources :

Example 1 with Pose

use of net.minecraft.entity.Pose in project VariousOddities by Lyinginbedmon.

the class EntityMarimoRenderer method applyRotations.

protected void applyRotations(EntityMarimo entityLiving, MatrixStack matrixStackIn, float ageInTicks, float rotationYaw, float partialTicks) {
    Pose pose = entityLiving.getPose();
    if (pose != Pose.SLEEPING) {
        matrixStackIn.rotate(Vector3f.YP.rotationDegrees(180.0F - rotationYaw));
    }
    if (entityLiving.deathTime > 0) {
        float f = Math.min(1F, MathHelper.sqrt(((float) entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F));
        matrixStackIn.rotate(Vector3f.ZP.rotationDegrees(f * 90F));
    } else if (entityLiving.isSpinAttacking()) {
        matrixStackIn.rotate(Vector3f.XP.rotationDegrees(-90.0F - entityLiving.rotationPitch));
        matrixStackIn.rotate(Vector3f.YP.rotationDegrees(((float) entityLiving.ticksExisted + partialTicks) * -75.0F));
    }
}
Also used : Pose(net.minecraft.entity.Pose)

Aggregations

Pose (net.minecraft.entity.Pose)1