-
Notifications
You must be signed in to change notification settings - Fork 0
Ticks Done
- ROUGH DRAFT
Ticks Done describes the amount of ticks done for an animation, starting at 0.
For example, given an animation of length 5 ticks, ticksDone = 0
would be the start, ticksDone = 2.5
would be the middle and ticksDone = 5
would be the end.
You need to have a counter to store the amount of ticks done for an animation. This counter would reset to 0 every time a new animation is played.
Luckily, there is an internal ticksDone storage. Simply call getTicksDone(Entity, float)
to retrieve it. This will automatically reset when a new animation starts. Remember - this is optional, if you want to do your own storage of ticksDone
, you are perfectly welcome.
for example: this.playAnimationWalking(entity, this.getTicksDone(entity, partialTicks));
To change the animation speed, simply add a multiplier to ticksDone.
for example: this.playAnimationWalking(entity, entity.animationTicks * 3F);
would play the animation 3 times faster