Class RegisterJsonAnimationTypesEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RegisterJsonAnimationTypesEvent
- All Implemented Interfaces:
IModBusEvent
public class RegisterJsonAnimationTypesEvent
extends net.neoforged.bus.api.Event
implements IModBusEvent
Allows registering custom
AnimationTargets and
interpolation functions for loading JSON entity animation files.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ImmutableMap.Builder<ResourceLocation, AnimationChannel.Interpolation> private final Map<ResourceLocation, AnimationChannel.Interpolation> private final Map<ResourceLocation, AnimationTarget> private final ImmutableMap.Builder<ResourceLocation, AnimationTarget> -
Constructor Summary
ConstructorsConstructorDescriptionRegisterJsonAnimationTypesEvent(ImmutableMap.Builder<ResourceLocation, AnimationTarget> targets, ImmutableMap.Builder<ResourceLocation, AnimationChannel.Interpolation> interpolations) -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> voidcheckDuplicate(String what, ResourceLocation key, Map<ResourceLocation, T> by, T obj) voidregisterInterpolation(ResourceLocation key, AnimationChannel.Interpolation interpolation) Register a custominterpolation functionwith the specifiedkey.voidregisterTarget(ResourceLocation key, AnimationTarget target) Register a customAnimationTargetwith the specifiedkey.
-
Field Details
-
targets
-
interpolations
-
registeredTargets
-
registeredInterpolations
-
-
Constructor Details
-
RegisterJsonAnimationTypesEvent
@Internal public RegisterJsonAnimationTypesEvent(ImmutableMap.Builder<ResourceLocation, AnimationTarget> targets, ImmutableMap.Builder<ResourceLocation, AnimationChannel.Interpolation> interpolations)
-
-
Method Details
-
registerTarget
Register a customAnimationTargetwith the specifiedkey. -
registerInterpolation
public void registerInterpolation(ResourceLocation key, AnimationChannel.Interpolation interpolation) Register a custominterpolation functionwith the specifiedkey. -
checkDuplicate
private static <T> void checkDuplicate(String what, ResourceLocation key, Map<ResourceLocation, T> by, T obj)
-