Not Enough Animations

Not Enough Animations

58M Downloads

Vanilla Eating Animation

StunfMC opened this issue ยท 20 comments

commented

Currently with this mod enabled, the third person eating animation is inconsistent with the vanilla first person animation. The third person eating animation is too fast, rough, and not as smooth as the first person counterpart. I've been looking for a mod that adds the same feeling of the first person eating animation to third person, and hopefully you could change it (or add a option for the almost exact animation as the first person animation in third person) to be like the first person animation.

commented

Weird, it seems to be faster on my screen. I guess I could be an idiot. Sorry for the trouble.

commented

Huh, let me look at the code what determines the speed.

commented

I mean the actual first-person one doesn't really work since there is no hand involved(the item can't just move straight up and down in front of the mouth). The animation should also play not rough and really smooth.

commented

I see that, but the third person is just too fast in my opinion. Maybe you could slow it down slightly? And the Animation Smoothing makes everything feel sluggish for me, maybe just my opinion. Either way, everything else is quite nice.

commented
bnMP9dKD8z.mp4
commented

Sorry for the trouble, I just get really picky with how my game looks sometimes, and I really like your mod and want to add it.

commented

https://github.com/tr7zw/NotEnoughAnimations/blob/1.19/Shared/src/main/java/dev/tr7zw/notenoughanimations/animations/hands/EatDrinkAnimation.java#L74 currently it uses the System clock in a sinus wave with some modifications. I am aware that for some people the animation smoothing just doesn't work correctly, and perhaps that could be linked too(assuming the system time for some jvm/operating system combinations is just behaving oddly). Is there anything unusual about your setup that I could look into? (M1 mac, Linux, some weird jvm?)

Note: I don't yet know why it doesn't work correctly for some.

commented

Right now I am on a Windows PC. I don't think anything is off about the JVM modification. I might just not be used to the animation being different. Is there a way to maybe make a option so the third person animation syncs with the rhythm of the first person one? That might seem stupid but just a genuine question. Maybe it is but my eyes are just not making it look that way.

commented

Uhhh not sure. I'd have to look into how the vanilla-eating animation is working, and then check how close that can be applied here.

commented
vvWJjouuc2.mp4

This is now technically 1:1 the first-person animation in 3rd person. But looks kinda bad, I'd make it a few times more extreme.

commented
	private void applyEatTransform(PoseStack poseStack, float f, HumanoidArm humanoidArm, ItemStack itemStack) {
		float g = this.minecraft.player.getUseItemRemainingTicks() - f + 1.0F;
		float h = g / itemStack.getUseDuration();
		if (h < 0.8F) {
			float f1 = Mth.abs(Mth.cos(g / 4.0F * 3.1415927F) * 0.1F);
			poseStack.translate(0.0D, f1, 0.0D);
		}
		float i = 1.0F - (float) Math.pow(h, 27.0D);
		int j = (humanoidArm == HumanoidArm.RIGHT) ? 1 : -1;
		poseStack.translate((i * 0.6F * j), (i * -0.5F), (i * 0.0F));
		poseStack.mulPose(Vector3f.YP.rotationDegrees(j * i * 90.0F));
		poseStack.mulPose(Vector3f.XP.rotationDegrees(i * 10.0F));
		poseStack.mulPose(Vector3f.ZP.rotationDegrees(j * i * 30.0F));
	}

This is the vanilla logic, it uses cos instead of sin, so that might be why it appears out of phase. Let me try a bit.

commented
6xdtcOXigP.mp4
commented

I like that! Looks really good. (Again, sorry if this is too much trouble, I get really picky sometimes and I know that coding a mod takes a lot of work and patience) :)

commented

Yeah, I see that now. If making it more extreme doesn't work, I understand. :)

commented
4uOc2DlBEL.mp4

How about this? 1:1 the exact values as the first-person animation, but * 0.3 instead of * 0.1? (So just more movement, but at the same speed/interval)

commented

How about 0.2? Just curious. (Sorry if this is too much)

commented

Eh, I had worse requests. This mod mainly aims to add missing/broken 3rd person animations, but some people want custom walking/sneaking and whatever animations, which is not really the point. Let me push it, then you can give it a try.

commented

Thank you!

commented

Have you tried? Then it will be in the next release.

commented

Yes, it works perfectly. Thank you very much! :)