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 Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     
    static final net.minecraft.client.animation.AnimationDefinition
     
    private final net.minecraft.resources.ResourceLocation
     
    private static final org.slf4j.Logger
     
    private @Nullable net.minecraft.client.animation.AnimationDefinition
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnimationHolder(net.minecraft.resources.ResourceLocation key)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    bind(net.minecraft.client.animation.AnimationDefinition value)
     
    net.minecraft.client.animation.AnimationDefinition
    get()
    Gets the currently loaded animation.
    @Nullable net.minecraft.client.animation.AnimationDefinition
    Gets the currently loaded animation or null if it has not been loaded.
    boolean
    Returns whether the animation has been loaded.
    net.minecraft.resources.ResourceLocation
    key()
    Gets the key associated with this animation.
    (package private) void
     

    Methods inherited from class java.lang.Object

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

    • EMPTY_ANIMATION

      public static final net.minecraft.client.animation.AnimationDefinition EMPTY_ANIMATION
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • key

      private final net.minecraft.resources.ResourceLocation key
    • value

      @Nullable private @Nullable net.minecraft.client.animation.AnimationDefinition value
    • absentWarned

      private boolean absentWarned
  • Constructor Details

    • AnimationHolder

      AnimationHolder(net.minecraft.resources.ResourceLocation key)
  • Method Details

    • unbind

      void unbind()
    • bind

      void bind(net.minecraft.client.animation.AnimationDefinition value)
    • key

      public net.minecraft.resources.ResourceLocation key()
      Gets the key associated with this animation.
    • get

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

      @Nullable public @Nullable net.minecraft.client.animation.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.