Class AnimationManager
java.lang.Object
dev.bouncingelf10.timelesslib.api.animation.AnimationManager
Owns and drives every
Obtain the shared instance through
AnimationTimeline. Obtain the shared instance through
TimelessLib.animations() / TimelessLibClient.animations() -
this class cannot be constructed by other mods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTimeline(AnimationTimeline timeline) createTimeline(net.minecraft.resources.Identifier id) getOrCreateTimeline(net.minecraft.resources.Identifier id) Gets the existing timeline for the given ID, or creates and registers a new one if absent.getTimeline(net.minecraft.resources.Identifier id) Gets a timeline by its ID.voidpauseAll()Pauses every registered timeline.booleanremoveTimeline(net.minecraft.resources.Identifier id) voidstopAll()Stops every registered timeline.voidupdate()DO NOT CALL THIS, it is already handled for you.
-
Constructor Details
-
AnimationManager
-
-
Method Details
-
createTimeline
-
getOrCreateTimeline
Gets the existing timeline for the given ID, or creates and registers a new one if absent.- Parameters:
id- Timeline ID- Returns:
AnimationTimeline
-
addTimeline
-
getTimeline
Gets a timeline by its ID.
Note: Returns an empty Optional if the timeline does not exist.- Parameters:
id- Timeline ID- Returns:
AnimationTimelineor empty
-
removeTimeline
public boolean removeTimeline(net.minecraft.resources.Identifier id) -
pauseAll
public void pauseAll()Pauses every registered timeline. -
stopAll
public void stopAll()Stops every registered timeline. -
update
public void update()DO NOT CALL THIS, it is already handled for you.
-