Class StateSupport

java.lang.Object
com.hypixel.hytale.server.npc.role.support.StateSupport

public class StateSupport extends Object
  • Field Details

    • NO_STATE

      public static final int NO_STATE
      See Also:
    • NPC_COMPONENT_TYPE

      @Nullable protected static final ComponentType<EntityStore,NPCEntity> NPC_COMPONENT_TYPE
    • stateHelper

      protected final StateMappingHelper stateHelper
    • startState

      protected final int startState
    • startSubState

      protected final int startSubState
    • state

      protected int state
    • subState

      protected int subState
    • componentLocalStateMachines

      protected it.unimi.dsi.fastutil.ints.Int2IntMap componentLocalStateMachines
    • localStateMachineAutoResetStates

      protected BitSet localStateMachineAutoResetStates
    • busyStates

      protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.IntSet> busyStates
    • missingStates

      protected final HashSet<String> missingStates
    • needClearOnce

      protected boolean needClearOnce
    • interactablePlayers

      protected Set<Ref<EntityStore>> interactablePlayers
    • interactedPlayers

      protected Set<Ref<EntityStore>> interactedPlayers
    • contextualInteractions

      protected Map<Ref<EntityStore>,String> contextualInteractions
    • interactionIterationTarget

      @Nullable protected Ref<EntityStore> interactionIterationTarget
    • stateTransitionController

      @Nullable protected final StateTransitionController stateTransitionController
  • Constructor Details

  • Method Details

    • getStateTransitionController

      @Nullable public StateTransitionController getStateTransitionController()
    • getStateHelper

      public StateMappingHelper getStateHelper()
    • postRoleBuilt

      public void postRoleBuilt(@Nonnull BuilderSupport builderSupport)
    • update

      public void update(@Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • 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

      public boolean inState(String state, String subState)
    • getStateName

      @Nonnull public String getStateName()
    • getStateName

      @Nonnull public String getStateName(int state, int subState)
    • getStateIndex

      public int getStateIndex()
    • getSubStateIndex

      public int getSubStateIndex()
    • appendStateName

      public void appendStateName(@Nonnull StringBuilder builder)
    • 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

      public void setSubState(String subState)
    • 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

      public void addContextualInteraction(@Nonnull Ref<EntityStore> playerRef, @Nonnull String context)
    • hasContextualInteraction

      public boolean hasContextualInteraction(@Nonnull Ref<EntityStore> playerReference, @Nonnull String context)
    • addInteraction

      public void addInteraction(@Nonnull Player player)
    • consumeInteraction

      public boolean consumeInteraction(@Nonnull Ref<EntityStore> playerReference)
    • setInteractable

      public void setInteractable(@Nonnull Ref<EntityStore> playerReference, boolean interactable)
    • setInteractable

      public void setInteractable(@Nonnull Ref<EntityStore> entityRef, @Nonnull Ref<EntityStore> playerReference, boolean interactable, @Nullable String hint, boolean showPrompt, @Nonnull Store<EntityStore> store)
    • sendInteractionHintToPlayer

      private void sendInteractionHintToPlayer(@Nonnull Ref<EntityStore> entityRef, @Nonnull Ref<EntityStore> playerReference, @Nonnull String hint, @Nonnull Store<EntityStore> store)
    • setInteractionIterationTarget

      public void setInteractionIterationTarget(@Nullable Ref<EntityStore> playerReference)
    • getInteractionIterationTarget

      @Nullable public Ref<EntityStore> getInteractionIterationTarget()
    • willInteractWith

      public boolean willInteractWith(@Nonnull Ref<EntityStore> playerReference)
    • runTransitionActions

      public boolean runTransitionActions(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, double dt, @Nonnull Store<EntityStore> store)
    • isRunningTransitionActions

      public boolean isRunningTransitionActions()
    • activate

      public void activate()