Class AnimationLoader
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.neoforged.neoforge.client.entity.animation.json.AnimationLoader
- All Implemented Interfaces:
PreparableReloadListener
public final class AnimationLoader
extends ContextAwareReloadListener
implements PreparableReloadListener
A loader for entity animations written in JSON. You can also get parsed animations from this class.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface PreparableReloadListener
PreparableReloadListener.PreparationBarrier, PreparableReloadListener.SharedState, PreparableReloadListener.StateKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Identifier, AnimationHolder> static final AnimationLoaderprivate static final FileToIdConverterprivate static final org.slf4j.Loggerprivate final List<AnimationHolder> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapply(Map<Identifier, AnimationDefinition> animationJsons) @Nullable AnimationDefinitiongetAnimation(Identifier key) Gets a loadedAnimationDefinitionwith the specifiedkey.Returns anAnimationHolderfor an animation.private Map<Identifier, AnimationDefinition> prepare(ResourceManager resourceManager) voidprepareSharedState(PreparableReloadListener.SharedState sharedState) reload(PreparableReloadListener.SharedState sharedState, Executor prepareExecutor, PreparableReloadListener.PreparationBarrier barrier, Executor applyExecutor) Methods inherited from class ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOpsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PreparableReloadListener
getName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
INSTANCE
-
STATE_KEY
-
LISTER
-
animations
-
strongHolderReferences
-
-
Constructor Details
-
AnimationLoader
private AnimationLoader()
-
-
Method Details
-
getAnimation
Gets a loadedAnimationDefinitionwith the specifiedkey. -
getAnimationHolder
Returns anAnimationHolderfor an animation. If the specified animation has not been loaded, the holder will be unbound, but may be bound in the future. -
prepare
-
apply
-