Class Instruction
java.lang.Object
com.hypixel.hytale.server.npc.instructions.Instruction
- All Implemented Interfaces:
RoleStateChange,IAnnotatedComponent,IAnnotatedComponentCollection
- Direct Known Subclasses:
InstructionRandomized
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ActionListprotected final BodyMotionprotected booleanstatic final Instruction[]protected final HeadMotionprotected intprotected final Instruction[]protected final booleanstatic final com.hypixel.hytale.logger.HytaleLoggerprotected final Stringprotected IAnnotatedComponentprotected Instructionprotected final Sensorprotected final Stringprotected final booleanprotected final double -
Constructor Summary
ConstructorsModifierConstructorDescriptionInstruction(BuilderInstruction builder, Sensor sensor, Instruction[] instructionList, BuilderSupport support) privateInstruction(Instruction[] instructionList, BuilderSupport support) -
Method Summary
Modifier and TypeMethodDescriptionvoidintstatic InstructioncreateRootInstruction(Instruction[] instructions, BuilderSupport support) voidexecute(Ref<EntityStore> ref, Role role, double dt, Store<EntityStore> store) voidexecuteActions(Ref<EntityStore> ref, Role role, InfoProvider sensorInfo, double dt, Store<EntityStore> store) protected <T,U, V> void forEachInstruction(QuadConsumer<Instruction, T, U, V> instructionConsumer, T t, U u, V v) protected <T> voidforEachInstruction(BiConsumer<Instruction, T> instructionConsumer, T obj) protected voidforEachInstruction(Consumer<Instruction> instructionConsumer) getComponent(int index) intgetIndex()voidgetInfo(Role role, ComponentInfo holder) getLabel()doublebooleanvoidbooleanmatches(Ref<EntityStore> ref, Role role, double dt, Store<EntityStore> store) voidmotionControllerChanged(Ref<EntityStore> ref, NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, ComponentAccessor<EntityStore> componentAccessor) voidvoidonCompleted(Role role) voidvoidvoidregisterWithSupport(Role role) voidvoidreset()voidsetContext(IAnnotatedComponent parent, int index) voidvoidteleported(Role role, World from, World to) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.server.npc.util.IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs
-
Field Details
-
EMPTY_ARRAY
-
LOGGER
public static final com.hypixel.hytale.logger.HytaleLogger LOGGER -
parent
-
name
-
tag
-
sensor
-
index
protected int index -
instructionList
-
bodyMotion
-
headMotion
-
actions
-
weight
protected final double weight -
treeMode
protected final boolean treeMode -
invertTreeModeResult
protected final boolean invertTreeModeResult -
continueAfter
protected boolean continueAfter -
parentTreeModeStep
-
-
Constructor Details
-
Instruction
-
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
-
getHeadMotion
-
registerWithSupport
- Specified by:
registerWithSupportin interfaceRoleStateChange
-
motionControllerChanged
public void motionControllerChanged(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.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()- Specified by:
componentCountin interfaceIAnnotatedComponentCollection
-
getComponent
- Specified by:
getComponentin interfaceIAnnotatedComponentCollection
-
getInfo
- Specified by:
getInfoin interfaceIAnnotatedComponent
-
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 Role role, double dt, @Nonnull Store<EntityStore> store) -
executeActions
public void executeActions(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) -
execute
public void execute(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, double dt, @Nonnull Store<EntityStore> store) -
clearOnce
public void clearOnce() -
onEndMotion
public void onEndMotion() -
onMatched
-
onCompleted
-
notifyChildSensorMatch
public void notifyChildSensorMatch() -
reset
public void reset() -
forEachInstruction
-
forEachInstruction
protected <T> void forEachInstruction(@Nonnull BiConsumer<Instruction, T> instructionConsumer, T obj) -
forEachInstruction
protected <T,U, void forEachInstructionV> (@Nonnull QuadConsumer<Instruction, T, U, V> instructionConsumer, T t, U u, V v) -
createRootInstruction
@Nonnull public static Instruction createRootInstruction(Instruction[] instructions, @Nonnull BuilderSupport support)
-