Class Animators

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.armature.Animators

public final class Animators extends Object
The animators of armature-driven things on this client, for client code that wants to play something itself (the server's way is ArmatureControl). An animator exists once its owner has been drawn.
Animators.whenReady(entity, animator -> animator.play("action", Motion.once("roar")));
Animator animator = Animators.of(blockEntity);   // null if it hasn't been drawn
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable Animator
    of(net.minecraft.world.entity.Entity entity)
     
    static @Nullable Animator
    of(net.minecraft.world.item.ItemStack stack)
    The animator of this very stack (each stack has its own).
    static @Nullable Animator
    of(net.minecraft.world.level.block.entity.BlockEntity blockEntity)
     
    static void
    whenReady(Object owner, Consumer<Animator> action)
    Runs code on an entity's, block entity's or stack's animator: now if it has one, else when it is first drawn, provided that is within a second.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      @Nullable public static @Nullable Animator of(net.minecraft.world.entity.Entity entity)
    • of

      @Nullable public static @Nullable Animator of(net.minecraft.world.level.block.entity.BlockEntity blockEntity)
    • of

      @Nullable public static @Nullable Animator of(net.minecraft.world.item.ItemStack stack)
      The animator of this very stack (each stack has its own).
    • whenReady

      public static void whenReady(Object owner, Consumer<Animator> action)
      Runs code on an entity's, block entity's or stack's animator: now if it has one, else when it is first drawn, provided that is within a second.