Class AnimationStateMachine
java.lang.Object
net.minecraftforge.common.model.animation.AnimationStateMachine
- All Implemented Interfaces:
IAnimationStateMachine
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final class
private static final class
private static enum
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final com.google.gson.Gson
private static final com.google.common.cache.LoadingCache<org.apache.commons.lang3.tuple.Triple<? extends IClip,
Float, Float>, org.apache.commons.lang3.tuple.Pair<IModelTransform, Iterable<Event>>> private IClip
private String
private float
private static final org.apache.logging.log4j.Logger
private static final AnimationStateMachine
private final com.google.common.collect.ImmutableMap<String,
ITimeValue> private boolean
private final String
private final com.google.common.collect.ImmutableList<String>
-
Constructor Summary
ConstructorDescriptionAnimationStateMachine
(com.google.common.collect.ImmutableMap<String, ITimeValue> parameters, com.google.common.collect.ImmutableMap<String, IClip> clips, com.google.common.collect.ImmutableList<String> states, com.google.common.collect.ImmutableMultimap<String, String> transitions, String startState) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.lang3.tuple.Pair<IModelTransform,
Iterable<Event>> apply
(float time) Sample the state and events at the current time.Get current state name.static AnimationStateMachine
(package private) void
post-loading initialization hook.static IAnimationStateMachine
load
(IResourceManager manager, ResourceLocation location, com.google.common.collect.ImmutableMap<String, ITimeValue> customParameters) Load a new instance if AnimationStateMachine at specified location, with specified custom parameters.void
shouldHandleSpecialEvents
(boolean value) Set to true if the machine should handle special events that come from the clips (they start with '!').void
transition
(String newState) Transition to a new state.
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
parameters
-
clips
-
states
-
transitions
-
startState
-
shouldHandleSpecialEvents
private transient boolean shouldHandleSpecialEvents -
currentStateName
-
currentState
-
lastPollTime
private transient float lastPollTime -
clipCache
-
missing
-
asmGson
private static final com.google.gson.Gson asmGson
-
-
Constructor Details
-
AnimationStateMachine
public AnimationStateMachine(com.google.common.collect.ImmutableMap<String, ITimeValue> parameters, com.google.common.collect.ImmutableMap<String, IClip> clips, com.google.common.collect.ImmutableList<String> states, com.google.common.collect.ImmutableMultimap<String, String> transitions, String startState)
-
-
Method Details
-
initialize
void initialize()post-loading initialization hook. -
apply
Description copied from interface:IAnimationStateMachine
Sample the state and events at the current time. Event iterable will contain all events that happened from the last invocation of this method, from most to least recent. Event offset is relative to the previous event, and for the first event it's relative to the current time.- Specified by:
apply
in interfaceIAnimationStateMachine
-
transition
Description copied from interface:IAnimationStateMachine
Transition to a new state.- Specified by:
transition
in interfaceIAnimationStateMachine
-
currentState
Description copied from interface:IAnimationStateMachine
Get current state name.- Specified by:
currentState
in interfaceIAnimationStateMachine
-
shouldHandleSpecialEvents
public void shouldHandleSpecialEvents(boolean value) Description copied from interface:IAnimationStateMachine
Set to true if the machine should handle special events that come from the clips (they start with '!'). Right now only implemented event is "!transition:". Default value is true. - Specified by:
shouldHandleSpecialEvents
in interfaceIAnimationStateMachine
-
load
public static IAnimationStateMachine load(IResourceManager manager, ResourceLocation location, com.google.common.collect.ImmutableMap<String, ITimeValue> customParameters) Load a new instance if AnimationStateMachine at specified location, with specified custom parameters. -
getMissing
-