java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,net.minecraft.client.animation.AnimationDefinition>>
net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener<net.minecraft.client.animation.AnimationDefinition>
net.neoforged.neoforge.client.entity.animation.json.AnimationLoader
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener

public final class AnimationLoader extends net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener<net.minecraft.client.animation.AnimationDefinition>
A loader for entity animations written in JSON. You can also get parsed animations from this class.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<net.minecraft.resources.ResourceLocation,AnimationHolder>
     
    static final AnimationLoader
     
    private static final org.slf4j.Logger
     
    private final List<AnimationHolder>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    apply(Map<net.minecraft.resources.ResourceLocation,net.minecraft.client.animation.AnimationDefinition> animationJsons, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler)
     
    @Nullable net.minecraft.client.animation.AnimationDefinition
    getAnimation(net.minecraft.resources.ResourceLocation key)
    Gets a loaded AnimationDefinition with the specified key.
    getAnimationHolder(net.minecraft.resources.ResourceLocation key)
    Returns an AnimationHolder for an animation.

    Methods inherited from class net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener

    getPreparedPath, prepare, scanDirectory, scanDirectory, scanDirectoryWithOptionalValues

    Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener

    reload

    Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener

    getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOps

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    getName
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • INSTANCE

      public static final AnimationLoader INSTANCE
    • animations

      private final Map<net.minecraft.resources.ResourceLocation,AnimationHolder> animations
    • strongHolderReferences

      private final List<AnimationHolder> strongHolderReferences
  • Constructor Details

    • AnimationLoader

      private AnimationLoader()
  • Method Details

    • getAnimation

      @Nullable public @Nullable net.minecraft.client.animation.AnimationDefinition getAnimation(net.minecraft.resources.ResourceLocation key)
      Gets a loaded AnimationDefinition with the specified key.
    • getAnimationHolder

      public AnimationHolder getAnimationHolder(net.minecraft.resources.ResourceLocation key)
      Returns an AnimationHolder for an animation. If the specified animation has not been loaded, the holder will be unbound, but may be bound in the future.
    • apply

      protected void apply(Map<net.minecraft.resources.ResourceLocation,net.minecraft.client.animation.AnimationDefinition> animationJsons, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler)
      Specified by:
      apply in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,net.minecraft.client.animation.AnimationDefinition>>