Class AnimationLoader
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
FieldsModifier and TypeFieldDescriptionprivate final Map
<net.minecraft.resources.ResourceLocation, AnimationHolder> static final AnimationLoader
private static final org.slf4j.Logger
private final List
<AnimationHolder> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 loadedAnimationDefinition
with the specifiedkey
.getAnimationHolder
(net.minecraft.resources.ResourceLocation key) Returns anAnimationHolder
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
-
animations
-
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 loadedAnimationDefinition
with the specifiedkey
. -
getAnimationHolder
Returns anAnimationHolder
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 classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,
net.minecraft.client.animation.AnimationDefinition>>
-