Added Animation task consumers (much better than animation events)

This commit is contained in:
bigguy345 committed 2026-01-05 16:49:48 +02:00
1 parent c5c35a1113
commit a33acee117
2 files changed
+46 -1

No files matched your search

@@ -98,15 +98,18 @@ public class AnimationData implements IAnimationData {
this.isClientAnimating = this.allowAnimation && this.animation != null;
if (prevIsClientAnimating && (!this.isClientAnimating || this.animation != this.currentClientAnimation)) {
EventHooks.onAnimationEnded(this.currentClientAnimation);
this.currentClientAnimation.fireEndTask();
}
if (this.isClientAnimating) {
this.currentClientAnimation = this.animation;
}
if (this.animation != null && this.allowAnimation) {
this.animation.fireStartTask();
if (EventHooks.onAnimationStarted(this.animation))
return;
EventHooks.onAnimationFrameEntered(this.animation, this.animation.currentFrame());
this.animation.fireFrameTask(this.animation.currentFrame);
}
List<EntityPlayer> entities = sendingEntity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(