Package net.citizensnpcs.api.ai.tree
Class StatusCoercer
java.lang.Object
net.citizensnpcs.api.ai.tree.BehaviorGoalAdapter
net.citizensnpcs.api.ai.tree.StatusCoercer
Wraps an
Behavior
and returns a supplied BehaviorStatus
instead of the actual status.-
Method Summary
Modifier and TypeMethodDescriptionstatic StatusCoercer
coercing
(Behavior wrapping, com.google.common.base.Supplier<BehaviorStatus> to) void
reset()
Resets the goal and any resources or state it is holding.run()
Ticks the behavior, optionally changing the state that it is in.boolean
Methods inherited from class net.citizensnpcs.api.ai.tree.BehaviorGoalAdapter
create, run, shouldExecute
-
Method Details
-
reset
public void reset()Description copied from interface:Goal
Resets the goal and any resources or state it is holding. -
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)
-