Class AnimationHolder

java.lang.Object
net.neoforged.neoforge.client.entity.animation.json.AnimationHolder

public final class AnimationHolder extends Object
Holds a single AnimationDefinition loaded from resource packs. Objects of this class will be automatically updated with new AnimationDefinitions on reload.
  • Field Details

    • EMPTY_ANIMATION

      public static final AnimationDefinition EMPTY_ANIMATION
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • key

      private final Identifier key
    • value

      private @Nullable AnimationDefinition value
    • absentWarned

      private boolean absentWarned
  • Constructor Details

    • AnimationHolder

      AnimationHolder(Identifier key)
  • Method Details

    • unbind

      void unbind()
    • bind

      void bind(AnimationDefinition value)
    • key

      public Identifier key()
      Gets the key associated with this animation.
    • get

      public AnimationDefinition get()
      Gets the currently loaded animation. If the animation has not been loaded, returns EMPTY_ANIMATION.
    • getOrNull

      public @Nullable AnimationDefinition getOrNull()
      Gets the currently loaded animation or null if it has not been loaded.
    • isBound

      public boolean isBound()
      Returns whether the animation has been loaded.