minecraft-src/net/minecraft/client/animation/definitions/CreakingAnimation.java
2025-07-04 02:00:41 +03:00

238 lines
12 KiB
Java

package net.minecraft.client.animation.definitions;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.animation.AnimationChannel;
import net.minecraft.client.animation.AnimationDefinition;
import net.minecraft.client.animation.Keyframe;
import net.minecraft.client.animation.KeyframeAnimations;
import net.minecraft.client.animation.AnimationChannel.Interpolations;
import net.minecraft.client.animation.AnimationChannel.Targets;
import net.minecraft.client.animation.AnimationDefinition.Builder;
@Environment(EnvType.CLIENT)
public class CreakingAnimation {
public static final AnimationDefinition CREAKING_WALK = Builder.withLength(1.5F)
.looping()
.addAnimation("head", new AnimationChannel(Targets.POSITION, new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)))
.addAnimation("body", new AnimationChannel(Targets.POSITION, new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, -1.0F), Interpolations.LINEAR)))
.addAnimation(
"right_arm",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(10.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(-7.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.4167F, KeyframeAnimations.degreeVec(7.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.9167F, KeyframeAnimations.degreeVec(-10.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.0833F, KeyframeAnimations.degreeVec(-22.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.degreeVec(10.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.degreeVec(10.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"right_arm",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"left_arm",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-22.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(17.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.4167F, KeyframeAnimations.degreeVec(-10.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.9167F, KeyframeAnimations.degreeVec(17.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.0833F, KeyframeAnimations.degreeVec(30.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.degreeVec(-30.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.degreeVec(-22.5F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"left_arm",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"left_leg",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.3333F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.5F, KeyframeAnimations.degreeVec(40.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.6667F, KeyframeAnimations.degreeVec(60.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.8333F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.0F, KeyframeAnimations.degreeVec(-50.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.1667F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"left_leg",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.3333F, KeyframeAnimations.posVec(0.0F, 0.0F, 2.0F), Interpolations.LINEAR),
new Keyframe(0.5F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.5F), Interpolations.LINEAR),
new Keyframe(0.6667F, KeyframeAnimations.posVec(0.0F, 0.0F, -1.0F), Interpolations.LINEAR),
new Keyframe(0.8333F, KeyframeAnimations.posVec(0.0F, 2.0F, -3.5F), Interpolations.LINEAR),
new Keyframe(1.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.1667F, KeyframeAnimations.posVec(0.0F, 0.0F, -2.0F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.posVec(0.0F, 0.0F, 2.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"right_leg",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.1667F, KeyframeAnimations.degreeVec(-50.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.3333F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.5F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.6667F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.1667F, KeyframeAnimations.degreeVec(40.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.degreeVec(60.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"right_leg",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 2.0F, -3.5F), Interpolations.LINEAR),
new Keyframe(0.1667F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.3333F, KeyframeAnimations.posVec(0.0F, 0.0F, -2.0F), Interpolations.LINEAR),
new Keyframe(0.5F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.6667F, KeyframeAnimations.posVec(0.0F, 0.0F, 2.0F), Interpolations.LINEAR),
new Keyframe(1.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 2.0F), Interpolations.LINEAR),
new Keyframe(1.1667F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.5F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.posVec(0.0F, 0.0F, -1.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.posVec(0.0F, 2.0F, -3.5F), Interpolations.LINEAR)
)
)
.addAnimation(
"upper_body",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(-7.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.6667F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.8333F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.0833F, KeyframeAnimations.degreeVec(-7.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"upper_body",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 0.0F, 1.0F), Interpolations.LINEAR),
new Keyframe(0.6667F, KeyframeAnimations.posVec(0.0F, 0.0F, 1.0F), Interpolations.LINEAR),
new Keyframe(0.8333F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(1.0833F, KeyframeAnimations.posVec(0.0F, 0.0F, 1.0F), Interpolations.LINEAR),
new Keyframe(1.3333F, KeyframeAnimations.posVec(0.0F, 0.0F, 1.0F), Interpolations.LINEAR),
new Keyframe(1.5F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.build();
public static final AnimationDefinition CREAKING_ATTACK = Builder.withLength(0.375F)
.addAnimation(
"right_arm",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(21.1693F, 37.7555F, 122.3122F), Interpolations.LINEAR),
new Keyframe(0.125F, KeyframeAnimations.degreeVec(-60.349F, -31.3213F, -16.4846F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(-54.3924F, -22.7992F, -27.3049F), Interpolations.LINEAR),
new Keyframe(0.2917F, KeyframeAnimations.degreeVec(-53.0231F, -26.8304F, -30.5649F), Interpolations.LINEAR),
new Keyframe(0.375F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"left_arm",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(15.0F, 0.0F, -10.0F), Interpolations.LINEAR),
new Keyframe(0.125F, KeyframeAnimations.degreeVec(22.4229F, 1.9113F, -14.6211F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(38.9206F, -9.562F, -4.6084F), Interpolations.LINEAR),
new Keyframe(0.2917F, KeyframeAnimations.degreeVec(51.4206F, -9.562F, -4.6084F), Interpolations.LINEAR),
new Keyframe(0.375F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"upper_body",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-12.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.125F, KeyframeAnimations.degreeVec(11.1575F, 0.2125F, -2.2036F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(22.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.2917F, KeyframeAnimations.degreeVec(25.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.375F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.build();
public static final AnimationDefinition CREAKING_INVULNERABLE = Builder.withLength(0.2917F)
.addAnimation(
"upper_body",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.0833F, KeyframeAnimations.degreeVec(-5.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.1667F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"upper_body",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.0833F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"right_arm",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.0833F, KeyframeAnimations.degreeVec(17.5F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.1667F, KeyframeAnimations.degreeVec(-15.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"right_arm",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"left_arm",
new AnimationChannel(
Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.0833F, KeyframeAnimations.degreeVec(20.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.1667F, KeyframeAnimations.degreeVec(-15.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.addAnimation(
"left_arm",
new AnimationChannel(
Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR),
new Keyframe(0.25F, KeyframeAnimations.posVec(0.0F, 0.0F, 0.0F), Interpolations.LINEAR)
)
)
.build();
}