Class StatusCoercer

java.lang.Object
net.citizensnpcs.api.ai.tree.BehaviorGoalAdapter
net.citizensnpcs.api.ai.tree.StatusCoercer
All Implemented Interfaces:
Goal, Behavior

public class StatusCoercer extends BehaviorGoalAdapter
Wraps an Behavior and returns a supplied BehaviorStatus instead of the actual status.
  • Method Details

    • reset

      public void reset()
      Description copied from interface: Goal
      Resets the goal and any resources or state it is holding.
    • run

      public BehaviorStatus run()
      Description copied from interface: Behavior
      Ticks the behavior, optionally changing the state that it is in.
      Returns:
      The new status
    • shouldExecute

      public boolean shouldExecute()
      Returns:
      Whether the behavior is ready to run
    • coercing

      public static StatusCoercer coercing(Behavior wrapping, com.google.common.base.Supplier<BehaviorStatus> to)