Class AnimationStateMachine
java.lang.Object
net.minecraftforge.common.model.animation.AnimationStateMachine
- All Implemented Interfaces:
IAnimationStateMachine
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
private static class
private static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static com.google.gson.Gson
private static com.google.common.cache.LoadingCache<org.apache.commons.lang3.tuple.Triple<? extends IClip,Float,Float>,org.apache.commons.lang3.tuple.Pair<ModelState,Iterable<Event>>>
private IClip
private String
private float
private static org.apache.logging.log4j.Logger
private static AnimationStateMachine
private com.google.common.collect.ImmutableMap<String,ITimeValue>
private boolean
private String
private 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<ModelState,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(ResourceManager 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:<state_name>". Default value is true.- Specified by:
shouldHandleSpecialEvents
in interfaceIAnimationStateMachine
-
load
public static IAnimationStateMachine load(ResourceManager 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
-