Contents
Class ActionAttack
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.ActionBase
com.hypixel.hytale.server.npc.corecomponents.combat.ActionAttack
- All Implemented Interfaces:
Action, RoleStateChange, IAnnotatedComponent, IComponentExecutionControl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ThreadLocal<SingleCollector<BallisticData>> Thread-local collector for finding theBallisticDatafrom projectile interactions.Fields inherited from interface Action
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionActionAttack(BuilderActionAttack builderActionAttack, BuilderSupport builderSupport) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(ExecutionSupport executionSupport, InfoProvider infoProvider) Called when the action is activated.booleancanExecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) Test if an action can be executedvoiddeactivate(ExecutionSupport executionSupport, InfoProvider infoProvider) Called when the action is deactivated.booleanexecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) Execute actionMethods inherited from class ActionBase
clearOnce, isActivated, isTriggered, processDelay, setOnceMethods inherited from class AnnotatedComponentBase
getIndex, getInfo, getParent, setContextMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs, getIndex, getInfo, getLabel, getParent, setContextMethods inherited from interface RoleStateChange
loaded, motionControllerChanged, registerWithSupport, removed, spawned, teleported, unloaded
-
Field Details
-
THREAD_LOCAL_COLLECTOR
Thread-local collector for finding theBallisticDatafrom projectile interactions.The interaction must implement
BallisticDataProviderand be tagged withAimingReferenceto be considered for aiming.
-
-
Constructor Details
-
ActionAttack
public ActionAttack(@Nonnull BuilderActionAttack builderActionAttack, @Nonnull BuilderSupport builderSupport)
-
-
Method Details
-
canExecute
public boolean canExecute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) Description copied from interface:ActionTest if an action can be executed- Specified by:
canExecutein interfaceAction- Overrides:
canExecutein classActionBase- Parameters:
ref- The entity refexecutionSupport- The execution supportsensorInfo- SensorInfo with PositionProvider, PathProvider, etc if requireddt- The interval in seconds for this calculationstore- The component store- Returns:
- true if action can be executed else false to skip execution
-
execute
public boolean execute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) Description copied from interface:ActionExecute action- Specified by:
executein interfaceAction- Overrides:
executein classActionBase- Parameters:
ref- The entity refexecutionSupport- The execution supportsensorInfo- SensorInfo with PositionProvider, PathProvider, etc if requireddt- The interval in seconds for this calculationstore- The component store- Returns:
- true when executed action has finished else false when execution is not completed yet
-
activate
Description copied from interface:ActionCalled when the action is activated. In normal lists, this will be called for all actions in the list that can be executed. In blocking sequences, this will be called prior to beginning the first execution of the action in the current cycle.- Specified by:
activatein interfaceAction- Overrides:
activatein classActionBase- Parameters:
executionSupport- The execution supportinfoProvider- the InfoProvider from the parent sensor.
-
deactivate
Description copied from interface:ActionCalled when the action is deactivated. In normal lists, this will be called if the action cannot be executed. In blocking sequences, this will be called when the execution of the action completes before moving to the next action.- Specified by:
deactivatein interfaceAction- Overrides:
deactivatein classActionBase- Parameters:
executionSupport- The execution supportinfoProvider- the InfoProvider from the parent sensor.
-