Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getComponentType()
- get(Ref, ComponentAccessor)
- getStateTransitionController()
- getStateHelper()
- postRoleBuilt(BuilderSupport)
- update(ComponentAccessor)
- pollNeedClearOnce()
- inState(int)
- inSubState(int)
- inState(int, int)
- inState(String, String)
- getStateName()
- getStateName(int, int)
- getStateIndex()
- getSubStateIndex()
- appendStateName(StringBuilder)
- setState(int, int, boolean, boolean)
- setState(Ref, String, String, ComponentAccessor)
- setSubState(String)
- isClearBodyMotion()
- setClearBodyMotion(boolean)
- isClearHeadMotion()
- setClearHeadMotion(boolean)
- isComponentInState(int, int)
- setComponentState(int, int)
- resetLocalStateMachines()
- flockSetState(Ref, String, String, ComponentAccessor)
- isInBusyState()
- addContextualInteraction(Ref, String)
- hasContextualInteraction(Ref, String)
- addInteraction(Ref)
- consumeInteraction(Ref)
- setInteractable(Ref, boolean)
- setInteractable(Ref, Ref, boolean, String, boolean, Store)
- setInteractionIterationTarget(Ref)
- getInteractionIterationTarget()
- willInteractWith(Ref)
- runTransitionActions(Ref, ExecutionSupport, double, Store)
- isRunningTransitionActions()
- activate()
- clone()
Class StateSupport
java.lang.Object
com.hypixel.hytale.server.npc.role.support.StateSupport
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
-
Field Summary
FieldsFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidaddContextualInteraction(Ref<EntityStore> playerRef, String context) voidaddInteraction(Ref<EntityStore> playerReference) voidappendStateName(StringBuilder builder) clone()booleanconsumeInteraction(Ref<EntityStore> playerReference) voidflockSetState(Ref<EntityStore> ref, String state, String subState, ComponentAccessor<EntityStore> componentAccessor) static StateSupportget(Ref<EntityStore> ref, ComponentAccessor<EntityStore> accessor) static ComponentType<EntityStore, StateSupport> intgetStateName(int state, int subState) intbooleanhasContextualInteraction(Ref<EntityStore> playerReference, String context) booleaninState(int state) booleaninState(int state, int subState) booleanbooleaninSubState(int subState) booleanbooleanbooleanisComponentInState(int componentIndex, int targetState) booleanbooleanbooleanvoidpostRoleBuilt(BuilderSupport builderSupport) voidbooleanrunTransitionActions(Ref<EntityStore> ref, ExecutionSupport executionSupport, double dt, Store<EntityStore> store) voidsetClearBodyMotion(boolean clearBodyMotion) voidsetClearHeadMotion(boolean clearHeadMotion) voidsetComponentState(int componentIndex, int targetState) voidsetInteractable(Ref<EntityStore> playerReference, boolean interactable) voidsetInteractable(Ref<EntityStore> entityRef, Ref<EntityStore> playerReference, boolean interactable, String hint, boolean showPrompt, Store<EntityStore> store) voidsetInteractionIterationTarget(Ref<EntityStore> playerReference) Sets the interaction iteration target to the given entity referencevoidsetState(int state, int subState, boolean clearOnce, boolean skipTransition) voidsetState(Ref<EntityStore> ref, String state, String subState, ComponentAccessor<EntityStore> componentAccessor) voidsetSubState(String subState) voidupdate(ComponentAccessor<EntityStore> componentAccessor) booleanwillInteractWith(Ref<EntityStore> playerReference) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
NO_STATE
public static final int NO_STATE- See Also:
-
-
Constructor Details
-
StateSupport
-
-
Method Details
-
getComponentType
-
get
@Nonnull public static StateSupport get(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> accessor) -
getStateTransitionController
-
getStateHelper
-
postRoleBuilt
-
update
-
pollNeedClearOnce
public boolean pollNeedClearOnce() -
inState
public boolean inState(int state) -
inSubState
public boolean inSubState(int subState) -
inState
public boolean inState(int state, int subState) -
inState
-
getStateName
-
getStateName
-
getStateIndex
public int getStateIndex() -
getSubStateIndex
public int getSubStateIndex() -
appendStateName
-
setState
public void setState(int state, int subState, boolean clearOnce, boolean skipTransition) -
setState
public void setState(@Nonnull Ref<EntityStore> ref, @Nonnull String state, @Nullable String subState, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
setSubState
-
isClearBodyMotion
public boolean isClearBodyMotion() -
setClearBodyMotion
public void setClearBodyMotion(boolean clearBodyMotion) -
isClearHeadMotion
public boolean isClearHeadMotion() -
setClearHeadMotion
public void setClearHeadMotion(boolean clearHeadMotion) -
isComponentInState
public boolean isComponentInState(int componentIndex, int targetState) -
setComponentState
public void setComponentState(int componentIndex, int targetState) -
resetLocalStateMachines
public void resetLocalStateMachines() -
flockSetState
public void flockSetState(Ref<EntityStore> ref, @Nonnull String state, @Nullable String subState, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
isInBusyState
public boolean isInBusyState() -
addContextualInteraction
-
hasContextualInteraction
public boolean hasContextualInteraction(@Nonnull Ref<EntityStore> playerReference, @Nonnull String context) -
addInteraction
-
consumeInteraction
-
setInteractable
-
setInteractable
public void setInteractable(@Nonnull Ref<EntityStore> entityRef, @Nonnull Ref<EntityStore> playerReference, boolean interactable, @Nullable String hint, boolean showPrompt, @Nonnull Store<EntityStore> store) -
setInteractionIterationTarget
Sets the interaction iteration target to the given entity reference- Parameters:
playerReference- The entity reference of the target entity, ornullto clear
-
getInteractionIterationTarget
- Returns:
- the entity reference of the interaction iteration target, or
nullif none are set
-
willInteractWith
-
runTransitionActions
public boolean runTransitionActions(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, double dt, @Nonnull Store<EntityStore> store) -
isRunningTransitionActions
public boolean isRunningTransitionActions() -
activate
public void activate() -
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-