Class ExecutionSupport

java.lang.Object
com.hypixel.hytale.server.npc.instructions.ExecutionSupport

public final class ExecutionSupport extends Object
Per-execution scratch struct that bundles ECS support component references plus tree-mode runtime state for a single instruction-tree tick.

Get an instance via acquire(), populateFromEntity(Ref, ComponentAccessor) / populateFromHolder(Holder), do the work, then call clearForReuse() in a finally block.

  • Constructor Details

    • ExecutionSupport

      public ExecutionSupport()
  • Method Details

    • acquire

      @Nonnull public static ExecutionSupport acquire()
      Acquire an ExecutionSupport from the per-thread pool, or allocate a new one if the pool is empty. Always pair with try { ... } finally { es.clearForReuse(); } so the instance returns to the pool.
    • getStateSupport

      @Nonnull public StateSupport getStateSupport()
    • getMarkedEntitySupport

      @Nonnull public MarkedEntitySupport getMarkedEntitySupport()
    • getWorldSupport

      @Nonnull public WorldSupport getWorldSupport()
    • getEntitySupport

      @Nonnull public EntitySupport getEntitySupport()
    • getPositionCache

      @Nonnull public PositionCache getPositionCache()
    • getDebugSupport

      @Nonnull public DebugSupport getDebugSupport()
    • getFlagsComponent

      @Nonnull public FlagsComponent getFlagsComponent()
    • getCombatSupport

      @Nonnull public CombatSupport getCombatSupport()
    • getMotionContextSupport

      @Nonnull public MotionContextSupport getMotionContextSupport()
    • getDisplayNameSupport

      @Nonnull public DisplayNameSupport getDisplayNameSupport()
    • getPlayerTaskSupport

      @Nonnull public PlayerTaskSupport getPlayerTaskSupport()
    • getRoleIndex

      public int getRoleIndex()
    • getName

      @Nullable public String getName()
    • getRole

      @Nullable public Role getRole()
    • getNpcEntity

      @Nullable public NPCEntity getNpcEntity()
    • swapTreeModeSteps

      @Nullable public Instruction swapTreeModeSteps(@Nullable Instruction newStep)
    • notifySensorMatch

      public void notifySensorMatch()
    • populateFromEntity

      public void populateFromEntity(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> accessor)
      Lazy populate for the per-tick entity path: stashes the ref/accessor and clears support references so each support is fetched on first access via its getter.
    • populateFromHolder

      public void populateFromHolder(@Nonnull Holder<EntityStore> holder)
    • setRoleIndex

      public void setRoleIndex(int roleIndex)
    • setName

      public void setName(@Nullable String name)
    • getIndexedInstructions

      @Nullable public IndexedInstructions getIndexedInstructions()
    • setIndexedInstructions

      public void setIndexedInstructions(@Nullable IndexedInstructions indexedInstructions)
    • clearForReuse

      public void clearForReuse()
      Clear all populated state and return to the pool.