Class AnimationStateMachine
java.lang.Object
net.minecraftforge.common.model.animation.AnimationStateMachine
- All Implemented Interfaces:
IAnimationStateMachine
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final classprivate static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.gson.Gsonprivate 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 IClipprivate Stringprivate floatprivate static final org.apache.logging.log4j.Loggerprivate static final AnimationStateMachineprivate final com.google.common.collect.ImmutableMap<String,ITimeValue> private booleanprivate final Stringprivate final com.google.common.collect.ImmutableList<String> -
Constructor Summary
ConstructorsConstructorDescriptionAnimationStateMachine(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) voidpost-loading initialization hook.static IAnimationStateMachineload(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.voidshouldHandleSpecialEvents(boolean value) Set to true if the machine should handle special events that come from the clips (they start with '!').voidtransition(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:IAnimationStateMachineSample 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:
applyin interfaceIAnimationStateMachine
-
transition
Description copied from interface:IAnimationStateMachineTransition to a new state.- Specified by:
transitionin interfaceIAnimationStateMachine
-
currentState
Description copied from interface:IAnimationStateMachineGet current state name.- Specified by:
currentStatein interfaceIAnimationStateMachine
-
shouldHandleSpecialEvents
public void shouldHandleSpecialEvents(boolean value) Description copied from interface:IAnimationStateMachineSet 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:
shouldHandleSpecialEventsin 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
-