bernie-g / geckolib

GeckoLib is an animation engine for Minecraft mods, with support for complex 3D keyframe-based animations, numerous easings, concurrent animation support, sound and particle keyframes, event keyframes, math-based animations, and more. Available for all major modloaders.
https://geckolib.com
MIT License
600 stars 125 forks source link

[1.17.x Fabric] Entity animations with sound effects bug if the shouldLoop animation field is set to false #172

Closed ikerleon02 closed 2 years ago

ikerleon02 commented 3 years ago

When an entity animation (haven't checked block or item) is set not to loop (shouldLoop false), it looks like the sound listener is called multiple times per animation. (See gyazo link below)

When an entity is spawned the sound matches perfectly the animation and it is played perfectly. The problem starts when a second entity is spawned near it. When 2+ entities are close together, only one plays the normal sound. The others play the sound multiples times. The entity playing the normal sound changes with time.

As mentioned by Gecko in the discord, it might be the markNeedsReload() method of the controller with the shouldLoop field of the animation set to false.

Other scenarios played:

For further investigation, if needed, I link below the github repository of my mod, currenty using geckolib, as well as the animated entity class.

https://gyazo.com/a9ab82b34692b6d2f715cd12f7e963b2 https://github.com/ikerleon02/TheBirdwatchingMod/tree/1.17.1-fabric/src/main/java/com/ikerleon/birdwmod https://github.com/ikerleon02/TheBirdwatchingMod/blob/1.17.1-fabric/src/main/java/com/ikerleon/birdwmod/entity/BirdEntity.java

AzureDoom commented 2 years ago

Can you try this on the newest version I just pushed for 1.17.1? 3.0.29

ikerleon02 commented 2 years ago

Sure, i will try it this week. I let you know

El jue, 18 nov 2021 a las 20:47, AzureDoom @.***>) escribió:

Can you try this on the newest version I just pushed for 1.17.1? 3.0.29

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bernie-g/geckolib/issues/172#issuecomment-973203604, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJIREJF425KF23DHFWKFQ2DUMVJ6LANCNFSM5CXRD7UQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ikerleon02 commented 2 years ago

I gave it a try, since i had all setted up, and unfortunately it doesn't work either

AzureDoom commented 2 years ago

Hi @ikerleon02 we did some changes to the core since this, please try on the latest 1.18.1 as 1.17.1 is no longer supported.

AzureDoom commented 2 years ago

@ikerleon02 keyframes got an update in 1.18.1 via a core update, if you can try this in that.