Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getSensor()
- getDebugTag()
- getWeight()
- isContinueAfter()
- getBodyMotion()
- findNearestPrecedingBodyMotion(Class)
- getHeadMotion()
- registerWithSupport(ExecutionSupport)
- motionControllerChanged(Ref, NPCEntity, MotionController, ComponentAccessor)
- loaded(ExecutionSupport)
- spawned(ExecutionSupport)
- unloaded(ExecutionSupport)
- removed(ExecutionSupport)
- teleported(ExecutionSupport, World, World)
- componentCount()
- getComponent(int)
- getInfo(ExecutionSupport, ComponentInfo)
- getParent()
- getIndex()
- getLabel()
- setContext(IAnnotatedComponent, int)
- matches(Ref, ExecutionSupport, double, Store)
- executeActions(Ref, ExecutionSupport, InfoProvider, double, Store)
- execute(Ref, ExecutionSupport, double, Store)
- clearOnce()
- onEndMotion()
- onMatched(ExecutionSupport)
- onCompleted(ExecutionSupport)
- notifyChildSensorMatch()
- reset()
- createRootInstruction(Instruction[], BuilderSupport)
Class Instruction
java.lang.Object
com.hypixel.hytale.server.npc.instructions.Instruction
- All Implemented Interfaces:
RoleStateChange, IAnnotatedComponent, IAnnotatedComponentCollection
- Direct Known Subclasses:
InstructionRandomized
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstruction(BuilderInstruction builder, Sensor sensor, Instruction[] instructionList, BuilderSupport support) -
Method Summary
Modifier and TypeMethodDescriptionvoidintReturns the number of components aggregatedstatic InstructioncreateRootInstruction(Instruction[] instructions, BuilderSupport support) Generates a root instruction for use in a Role.voidexecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, double dt, Store<EntityStore> store) voidexecuteActions(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) <T extends BodyMotion>
TfindNearestPrecedingBodyMotion(Class<T> clazz) getComponent(int index) Returns the annotated component at the given index, or null if the component at said index is not annotatedintgetIndex()voidgetInfo(ExecutionSupport executionSupport, ComponentInfo holder) Populates the ComponentInfo holder with any relevant information relating to this particular componentgetLabel()doublebooleanvoidloaded(ExecutionSupport executionSupport) booleanmatches(Ref<EntityStore> ref, ExecutionSupport executionSupport, double dt, Store<EntityStore> store) voidmotionControllerChanged(Ref<EntityStore> ref, NPCEntity npcComponent, MotionController motionController, ComponentAccessor<EntityStore> componentAccessor) voidvoidonCompleted(ExecutionSupport executionSupport) voidvoidonMatched(ExecutionSupport executionSupport) voidregisterWithSupport(ExecutionSupport executionSupport) voidremoved(ExecutionSupport executionSupport) voidreset()voidsetContext(IAnnotatedComponent parent, int index) voidspawned(ExecutionSupport executionSupport) voidteleported(ExecutionSupport executionSupport, World from, World to) voidunloaded(ExecutionSupport executionSupport) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs
-
Field Details
-
EMPTY_ARRAY
-
LOGGER
-
-
Constructor Details
-
Instruction
public Instruction(@Nonnull BuilderInstruction builder, Sensor sensor, @Nullable Instruction[] instructionList, @Nonnull BuilderSupport support)
-
-
Method Details
-
getSensor
-
getDebugTag
-
getWeight
public double getWeight() -
isContinueAfter
public boolean isContinueAfter() -
getBodyMotion
-
findNearestPrecedingBodyMotion
-
getHeadMotion
-
registerWithSupport
- Specified by:
registerWithSupportin interfaceRoleStateChange
-
motionControllerChanged
public void motionControllerChanged(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, MotionController motionController, @Nullable ComponentAccessor<EntityStore> componentAccessor) - Specified by:
motionControllerChangedin interfaceRoleStateChange
-
loaded
- Specified by:
loadedin interfaceRoleStateChange
-
spawned
- Specified by:
spawnedin interfaceRoleStateChange
-
unloaded
- Specified by:
unloadedin interfaceRoleStateChange
-
removed
- Specified by:
removedin interfaceRoleStateChange
-
teleported
- Specified by:
teleportedin interfaceRoleStateChange
-
componentCount
public int componentCount()Description copied from interface:IAnnotatedComponentCollectionReturns the number of components aggregated- Specified by:
componentCountin interfaceIAnnotatedComponentCollection- Returns:
- the number of components aggregated
-
getComponent
Description copied from interface:IAnnotatedComponentCollectionReturns the annotated component at the given index, or null if the component at said index is not annotated- Specified by:
getComponentin interfaceIAnnotatedComponentCollection- Parameters:
index- the index to fetch- Returns:
- the annotated component, or null if the component at the index is not annotated
-
getInfo
Description copied from interface:IAnnotatedComponentPopulates the ComponentInfo holder with any relevant information relating to this particular component- Specified by:
getInfoin interfaceIAnnotatedComponent- Parameters:
executionSupport- per-execution contextholder- the ComponentInfo instance to populate
-
getParent
- Specified by:
getParentin interfaceIAnnotatedComponent
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceIAnnotatedComponent
-
getLabel
- Specified by:
getLabelin interfaceIAnnotatedComponent
-
setContext
- Specified by:
setContextin interfaceIAnnotatedComponent
-
matches
public boolean matches(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, double dt, @Nonnull Store<EntityStore> store) -
executeActions
public void executeActions(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) -
execute
public void execute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, double dt, @Nonnull Store<EntityStore> store) -
clearOnce
public void clearOnce() -
onEndMotion
public void onEndMotion() -
onMatched
-
onCompleted
-
notifyChildSensorMatch
public void notifyChildSensorMatch() -
reset
public void reset() -
createRootInstruction
@Nonnull public static Instruction createRootInstruction(Instruction[] instructions, @Nonnull BuilderSupport support) Generates a root instruction for use in a Role.- Parameters:
instructions- List of instructions used by the Role.support- Builder support.- Returns:
- The generated root instruction.
-