Package dev.kosmx.playerAnim.api.layered
Class AnimationContainer<T extends IAnimation>
java.lang.Object
dev.kosmx.playerAnim.api.layered.AnimationContainer<T>
- Type Parameters:
T- Nullable animation
- All Implemented Interfaces:
IAnimation
- Direct Known Subclasses:
AbstractModifier
A container to make swapping animation object easier
It will clone the behaviour of the held animation
you can put endless AnimationContainer into each other
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Vec3fget3DTransform(@NotNull String modelName, @NotNull TransformType type, float tickDelta, @NotNull Vec3f value0) Get the transformed value to a model part, transform type.getAnim()@NotNull FirstPersonConfigurationgetFirstPersonConfiguration(float tickDelta) @NotNull FirstPersonModegetFirstPersonMode(float tickDelta) Active animation can request first person render mode.booleanisActive()Is the animation currently active.voidvoidsetupAnim(float tickDelta) Called before rendering a charactervoidtick()Animation tick, on lag free client 20 [tick/sec] You can get the animations time from other places, but it will be invoked when the animation is ACTIVE
-
Field Details
-
anim
-
-
Constructor Details
-
AnimationContainer
-
AnimationContainer
public AnimationContainer()
-
-
Method Details
-
setAnim
-
getAnim
-
isActive
public boolean isActive()Description copied from interface:IAnimationIs the animation currently active. Tick will only be invoked when ACTIVE- Specified by:
isActivein interfaceIAnimation- Returns:
- active
-
tick
public void tick()Description copied from interface:IAnimationAnimation tick, on lag free client 20 [tick/sec] You can get the animations time from other places, but it will be invoked when the animation is ACTIVE- Specified by:
tickin interfaceIAnimation
-
get3DTransform
@NotNull public @NotNull Vec3f get3DTransform(@NotNull @NotNull String modelName, @NotNull @NotNull TransformType type, float tickDelta, @NotNull @NotNull Vec3f value0) Description copied from interface:IAnimationGet the transformed value to a model part, transform type.- Specified by:
get3DTransformin interfaceIAnimation- Parameters:
modelName- The questionable model parttype- Transform typetickDelta- Time since the last tick. 0-1value0- The value before the transform. For identity transform return with it.- Returns:
- The new transform value
-
setupAnim
public void setupAnim(float tickDelta) Description copied from interface:IAnimationCalled before rendering a character- Specified by:
setupAnimin interfaceIAnimation- Parameters:
tickDelta- Time since the last tick. 0-1
-
getFirstPersonMode
Description copied from interface:IAnimationActive animation can request first person render mode.- Specified by:
getFirstPersonModein interfaceIAnimation- Parameters:
tickDelta- current tickDelta- Returns:
FirstPersonMode
-
getFirstPersonConfiguration
- Specified by:
getFirstPersonConfigurationin interfaceIAnimation- Parameters:
tickDelta-- Returns:
- current first person configuration, only requested when playing this animation
-