diff --git a/src/client/java/jesse/keeblarcraft/entity/animation/ModAnimations.java b/src/client/java/jesse/keeblarcraft/entity/animation/ModAnimations.java index 804aaeb..e4a3f45 100644 --- a/src/client/java/jesse/keeblarcraft/entity/animation/ModAnimations.java +++ b/src/client/java/jesse/keeblarcraft/entity/animation/ModAnimations.java @@ -1,464 +1,538 @@ package jesse.keeblarcraft.entity.animation; + import net.minecraft.client.render.entity.animation.Animation; import net.minecraft.client.render.entity.animation.AnimationHelper; import net.minecraft.client.render.entity.animation.Keyframe; import net.minecraft.client.render.entity.animation.Transformation; public class ModAnimations { - -public static final Animation PORCUPINE_WALK = Animation.Builder.create(2.5f).looping() -.addBoneAnimation("torso", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, 0f, -0.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.9583434f, AnimationHelper.createTranslationalVector(0f, 0f, -0.05f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, 0f, 0.05f), - Transformation.Interpolations.LINEAR), - new Keyframe(2.125f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_front_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0834333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.625f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2.0834335f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2.5f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_front_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0.20834334f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.5416766f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0834333f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.2916767f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.875f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_back_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.3433333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.875f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2.2916765f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2.5f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_back_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.3433333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.875f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5834333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2.0834335f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))).build(); -public static final Animation PORCUPINE_IDLE = Animation.Builder.create(2f).looping() -.addBoneAnimation("torso", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, 0.35f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.875f, AnimationHelper.createTranslationalVector(0f, 0.4f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0.4f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, 0.35f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.875f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("torso", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("skull", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.3433333f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, 0.2f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.9583433f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("skull", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.5f, AnimationHelper.createRotationalVector(2f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.75f, AnimationHelper.createRotationalVector(2f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createRotationalVector(-2f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createRotationalVector(-2f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_front_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.7083434f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_front_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.9167666f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.7916767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_back_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.125f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.7916767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_back_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.2916767f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.9167667f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))).build(); -public static final Animation PORCUPINE_ATTACK = Animation.Builder.create(2f).looping() -.addBoneAnimation("torso", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.6766666f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createTranslationalVector(0f, 0.5f, -1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0.5f, -1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5416767f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.875f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("torso", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5416767f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.6766667f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.875f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("skull", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5416767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.875f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("skull", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(15f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createRotationalVector(15f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createRotationalVector(15f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createRotationalVector(15f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5416767f, AnimationHelper.createRotationalVector(15f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.6766667f, AnimationHelper.createRotationalVector(15f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.875f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("hair", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes2", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes3", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes4", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes5", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes6", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes7", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("spikes8", - new Transformation(Transformation.Targets.SCALE, - new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_front_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_front_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_front_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_front_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_back_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_back_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createRotationalVector(10f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createRotationalVector(10f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createRotationalVector(10f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_back_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_back_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.25f, AnimationHelper.createRotationalVector(10f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createRotationalVector(10f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.5f, AnimationHelper.createRotationalVector(10f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))).build(); -public static final Animation PORCUPINE_SIT = Animation.Builder.create(2f).looping() -.addBoneAnimation("porcupine", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("torso", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -0.3f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(0.4583433f, AnimationHelper.createTranslationalVector(0f, 0.3f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.125f, AnimationHelper.createTranslationalVector(0f, 0.5f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.7916767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, -0.3f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("torso", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(-15f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("skull", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_front_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_front_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 0.25f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_back_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, -0.75f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("right_back_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_back_leg", - new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, -0.75f, 0f), - Transformation.Interpolations.LINEAR), - new Keyframe(1.9583433f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), - Transformation.Interpolations.LINEAR))) -.addBoneAnimation("left_back_leg", - new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(5f, 0f, 0f), - Transformation.Interpolations.LINEAR))).build(); + + public static final Animation PORCUPINE_WALK = Animation.Builder.create(2.5f).looping() + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167667f, AnimationHelper.createTranslationalVector(0f, 0f, -0.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.9583434f, AnimationHelper.createTranslationalVector(0f, 0f, -0.05f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, 0f, 0.05f), + Transformation.Interpolations.LINEAR), + new Keyframe(2.125f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_front_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0834333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.625f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2.0834335f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2.5f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_front_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0.20834334f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5416766f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0834333f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.2916767f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.875f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.3433333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.875f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2.2916765f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2.5f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.3433333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.875f, AnimationHelper.createRotationalVector(-11f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5834333f, AnimationHelper.createRotationalVector(-7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2.0834335f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))).build(); + public static final Animation PORCUPINE_IDLE = Animation.Builder.create(2f).looping() + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, 0.35f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.875f, AnimationHelper.createTranslationalVector(0f, 0.4f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0.4f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, 0.35f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.875f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("skull", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.3433333f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, 0.2f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.9583433f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("skull", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5f, AnimationHelper.createRotationalVector(2f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.75f, AnimationHelper.createRotationalVector(2f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createRotationalVector(-2f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createRotationalVector(-2f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.7083434f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.9167666f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.7916767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.125f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.7916767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_back_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.2916767f, AnimationHelper.createTranslationalVector(0f, 0.1f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.9167667f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))).build(); + public static final Animation PORCUPINE_ATTACK = Animation.Builder.create(2f).looping() + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.6766666f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createTranslationalVector(0f, 0.5f, -1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0.5f, -1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.875f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.6766667f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.875f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("skull", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.875f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("skull", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4167667f, AnimationHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5416767f, AnimationHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.6766667f, AnimationHelper.createRotationalVector(15f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.875f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("hair", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes2", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.25f, 1.25f, 1.25f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes3", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes4", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes5", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes6", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes7", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("spikes8", + new Transformation(Transformation.Targets.SCALE, + new Keyframe(1f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.0416767f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createScalingVector(1.15f, 1.15f, 1.15f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createScalingVector(1f, 1f, 1f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_front_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_front_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createRotationalVector(7.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_back_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.25f, AnimationHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.5f, AnimationHelper.createRotationalVector(10f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))).build(); + public static final Animation PORCUPINE_SIT = Animation.Builder.create(2f).looping() + .addBoneAnimation("porcupine", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -0.5f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -0.3f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.4583433f, AnimationHelper.createTranslationalVector(0f, 0.3f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.125f, AnimationHelper.createTranslationalVector(0f, 0.5f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.7916767f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, -0.3f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(-15f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("skull", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1f, AnimationHelper.createTranslationalVector(0f, 0.25f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, -0.75f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(2f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_back_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, -0.75f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.9583433f, AnimationHelper.createTranslationalVector(0f, -1f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(5f, 0f, 0f), + Transformation.Interpolations.LINEAR))).build(); + public static final Animation PORCUPINE_STAND_WALK = Animation.Builder.create(1.25f) + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 4f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 3f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("torso", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(-87.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createRotationalVector(-87.5f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("skull", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 1f, -2f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 1f, -2f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("skull", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(95f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createRotationalVector(95f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 4f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5834334f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 4f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("porcupine", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("tail", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_front_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5834334f, AnimationHelper.createTranslationalVector(0f, 4f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createTranslationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("right_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(27.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR))) + .addBoneAnimation("left_back_leg", + new Transformation(Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(0.5834334f, AnimationHelper.createRotationalVector(0f, 0f, 0f), + Transformation.Interpolations.LINEAR), + new Keyframe(1.25f, AnimationHelper.createRotationalVector(17.5f, 0f, 0f), + Transformation.Interpolations.LINEAR))).build(); } diff --git a/src/main/java/jesse/keeblarcraft/CustomBlocks/Blocks/FactionBaseBlock.java b/src/main/java/jesse/keeblarcraft/CustomBlocks/Blocks/FactionBaseBlock.java index 1a4d0d8..23b5926 100644 --- a/src/main/java/jesse/keeblarcraft/CustomBlocks/Blocks/FactionBaseBlock.java +++ b/src/main/java/jesse/keeblarcraft/CustomBlocks/Blocks/FactionBaseBlock.java @@ -94,7 +94,7 @@ public class FactionBaseBlock extends BlockWithEntity implements BlockEntityProv if (bEntity != null) { bEntity.ResetBlock(); } - }t + } // Disable chunk loading world.getChunkManager().setChunkForced(world.getChunk(pos).getPos(), false); diff --git a/src/main/java/jesse/keeblarcraft/CustomGoals/FollowPlayerCustomGoal.java b/src/main/java/jesse/keeblarcraft/CustomGoals/FollowPlayerCustomGoal.java new file mode 100644 index 0000000..2359855 --- /dev/null +++ b/src/main/java/jesse/keeblarcraft/CustomGoals/FollowPlayerCustomGoal.java @@ -0,0 +1,100 @@ +package jesse.keeblarcraft.CustomGoals; + +import net.minecraft.entity.ai.control.LookControl; +import net.minecraft.entity.ai.goal.Goal; +import net.minecraft.entity.ai.pathing.BirdNavigation; +import net.minecraft.entity.ai.pathing.EntityNavigation; +import net.minecraft.entity.ai.pathing.MobNavigation; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.entity.player.PlayerEntity; +import org.jetbrains.annotations.Nullable; + +import java.util.EnumSet; +import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; + + +public class FollowPlayerCustomGoal extends Goal { + private final AnimalEntity animal; + @Nullable + private final float maxDistance; + private final Predicate targetPredicate; + private PlayerEntity target; + private final EntityNavigation navigation; + private final float minFollowDistance; + private final float speed; + + public FollowPlayerCustomGoal(AnimalEntity animal, float maxDistance, float minDistance, float speed) { + this.animal = animal; + this.navigation = animal.getNavigation(); + this.maxDistance = maxDistance; + this.minFollowDistance = minDistance; + this.speed = speed; + + this.targetPredicate = Objects::nonNull; //make sure the target predicate is not null + + //some mob controls + this.setControls(EnumSet.of(Goal.Control.MOVE, Goal.Control.LOOK)); + if (!(animal.getNavigation() instanceof MobNavigation) && !(animal.getNavigation() instanceof BirdNavigation)) { + throw new IllegalArgumentException("Unsupported mob type for FollowMobGoal"); + } + } + + @Override + public boolean canStart () { + List list = this.animal + .getWorld() + .getEntitiesByClass(PlayerEntity.class, this.animal.getBoundingBox().expand((double)this.maxDistance), this.targetPredicate); + if (!list.isEmpty()) { + for (PlayerEntity player : list) { + if (!player.isInvisible()) { + this.target = player; + return true; + } + } + } + + return false; + } + + @Override + public boolean shouldContinue () { + return this.target != null && this.navigation.isIdle() && this.animal.squaredDistanceTo(this.target) > (double) (this.minFollowDistance * this.minFollowDistance); + } + + @Override + public void start() { + this.animal.getNavigation().startMovingTo(target, 0.5); + } + + @Override + public void stop() { + this.target = null; + this.navigation.stop(); + } + + @Override + public void tick() { + if (this.target == null && this.animal.isLeashed()) { + this.animal.getLookControl().lookAt(this.target, (float) 10, (float) this.animal.getMaxLookPitchChange()); + double x = this.animal.getX() - this.target.getX(); + double y = this.animal.getY() - this.target.getY(); + double z = this.animal.getZ() - this.target.getZ(); + double distance = x * x + y * y + z * z; + if (distance >= this.minFollowDistance * this.minFollowDistance) { + this.navigation.startMovingTo(this.target, this.speed); + } else { + this.navigation.stop(); + //LookControl lookControl = this.animal.getLookControl(); +// if (distance <= (double)this.minFollowDistance +// || lookControl.getLookX() == this.animal.getX() && lookControl.getLookY() == this.animal.getY() && lookControl.getLookZ() == this.animal.getZ()) { +// double h = this.target.getX() - this.animal.getX(); +// double i = this.target.getZ() - this.animal.getZ(); +// this.navigation.startMovingTo(this.animal.getX() - h, this.animal.getY(), this.animal.getZ() - i, this.speed); +// } + } + } + } + +} diff --git a/src/main/java/jesse/keeblarcraft/entity/PorcupineEntity.java b/src/main/java/jesse/keeblarcraft/entity/PorcupineEntity.java index 8f71b5e..0545751 100644 --- a/src/main/java/jesse/keeblarcraft/entity/PorcupineEntity.java +++ b/src/main/java/jesse/keeblarcraft/entity/PorcupineEntity.java @@ -1,6 +1,6 @@ package jesse.keeblarcraft.entity; -import jesse.keeblarcraft.entity.MAKE_ENTITY_REGISTER; +import jesse.keeblarcraft.CustomGoals.FollowPlayerCustomGoal; import net.minecraft.entity.AnimationState; import net.minecraft.entity.EntityPose; import net.minecraft.entity.EntityType; @@ -68,6 +68,8 @@ public class PorcupineEntity extends AnimalEntity { protected void initGoals() { this.goalSelector.add(0, new SwimGoal(this)); + //this.goalSelector.add(1, new FollowPlayerCustomGoal()); + this.goalSelector.add(1, new AnimalMateGoal(this, 5)); this.goalSelector.add(2, new TemptGoal(this, 2, Ingredient.ofItems(Items.BEETROOT), false)); @@ -83,6 +85,8 @@ public class PorcupineEntity extends AnimalEntity { this.goalSelector.add(6, new LookAroundGoal(this)); } + + public static DefaultAttributeContainer.Builder createPorcupineAttributes() { return MobEntity.createMobAttributes() .add(EntityAttributes.GENERIC_MAX_HEALTH, 10)