Contents
Class ActionBase
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.ActionBase
- All Implemented Interfaces:
Action, RoleStateChange, IAnnotatedComponent, IComponentExecutionControl
- Direct Known Subclasses:
ActionAddToTargetMemory, ActionAdjustPortalTimer, ActionAppearance, ActionApplyEntityEffect, ActionAttack, ActionBeacon, ActionBlockHitInteraction, ActionChangeTargetRole, ActionClearEncounterBossBar, ActionClearEncounterWeather, ActionCombatAbility, ActionCrouch, ActionDelayDespawn, ActionDespawn, ActionDie, ActionDisplayName, ActionEntityHitInteraction, ActionFlockBeacon, ActionFlockJoin, ActionFlockLeave, ActionFlockSetTarget, ActionFlockState, ActionGrantReward, ActionIgnoreForAvoidance, ActionInventory, ActionLockOnInteractionTarget, ActionLog, ActionMakePath, ActionModelAttachment, ActionMount, ActionNothing, ActionNotify, ActionOpenBarterShop, ActionOpenShop, ActionOverrideAltitude, ActionOverrideAttitude, ActionParentState, ActionPlaceBlock, ActionPlayAnimation, ActionRandom, ActionRecomputePath, ActionReleaseTarget, ActionRemove, ActionResetBlockSensors, ActionResetInstructions, ActionResetPath, ActionResetSearchRays, ActionRole, ActionSequence, ActionSetAlarm, ActionSetBlockToPlace, ActionSetEncounterAudioState, ActionSetEncounterBossBar, ActionSetEncounterWeather, ActionSetFlag, ActionSetHealthRegen, ActionSetInteractable, ActionSetInvulnerable, ActionSetLeashPosition, ActionSetMarkedTarget, ActionSetStat, ActionSetTargetNPCInvulnerable, ActionSignalTaggedVolumes, ActionSignalWorldEvent, ActionSpawn, ActionStartEncounterMusic, ActionStartObjective, ActionState, ActionStopEncounterMusic, ActionStorePosition, ActionTest, ActionTimer, ActionToggleStateEvaluator, ActionTriggerSpawnBeacon, ActionTriggerSpawners, ActionWithDelay, DeferrableAction
-
Field Summary
Fields inherited from interface Action
EMPTY_ARRAY -
Constructor Summary
Constructors -
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 executedvoidvoiddeactivate(ExecutionSupport executionSupport, InfoProvider infoProvider) Called when the action is deactivated.booleanexecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) Execute actionbooleanChecks if this action has been activated.booleanbooleanprocessDelay(float dt) Tick down the internal delay on this core componentvoidsetOnce()Methods 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
-
Constructor Details
-
ActionBase
-
-
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- 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- 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. -
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- Parameters:
executionSupport- The execution supportinfoProvider- the InfoProvider from the parent sensor.
-
isActivated
public boolean isActivated()Description copied from interface:ActionChecks if this action has been activated.- Specified by:
isActivatedin interfaceAction- Returns:
trueif activated,falseif not.
-
isTriggered
public boolean isTriggered()- Specified by:
isTriggeredin interfaceIComponentExecutionControl
-
clearOnce
public void clearOnce()- Specified by:
clearOncein interfaceIComponentExecutionControl
-
setOnce
public void setOnce()- Specified by:
setOncein interfaceIComponentExecutionControl
-
processDelay
public boolean processDelay(float dt) Description copied from interface:IComponentExecutionControlTick down the internal delay on this core component- Specified by:
processDelayin interfaceIComponentExecutionControl- Parameters:
dt- the tick duration- Returns:
- whether this component has finished processing its internal delay
-