Class AnimationHolder
java.lang.Object
net.neoforged.neoforge.client.entity.animation.json.AnimationHolder
Holds a single
AnimationDefinition
loaded from resource packs. Objects of this class will be automatically updated with new
AnimationDefinition
s on reload.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 -
Method Summary
Modifier and TypeMethodDescription(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
isBound()
Returns whether the animation has been loaded.net.minecraft.resources.ResourceLocation
key()
Gets the key associated with this animation.(package private) void
unbind()
-
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, returnsEMPTY_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.
-