Contents
Class SensorInteractionContext
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.SensorBase
com.hypixel.hytale.server.npc.corecomponents.interaction.SensorInteractionContext
- All Implemented Interfaces:
RoleStateChange, Sensor, IAnnotatedComponent, IComponentExecutionControl
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSensorInteractionContext(BuilderSensorInteractionContext builder, BuilderSupport support) -
Method Summary
Modifier and TypeMethodDescriptionGet access to sensor info result if the sensor supports this in principle.booleanmatches(Ref<EntityStore> ref, ExecutionSupport executionSupport, double dt, Store<EntityStore> store) Methods inherited from class SensorBase
clearOnce, 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
-
Constructor Details
-
SensorInteractionContext
public SensorInteractionContext(@Nonnull BuilderSensorInteractionContext builder, @Nonnull BuilderSupport support)
-
-
Method Details
-
matches
public boolean matches(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, double dt, @Nonnull Store<EntityStore> store) - Specified by:
matchesin interfaceSensor- Overrides:
matchesin classSensorBase
-
getSensorInfo
Description copied from interface:SensorGet access to sensor info result if the sensor supports this in principle.Sensors can provide positional (and other) information if they are in matching state, like SensorPlayer or SensorEntity, while for other sensors, like SensorState, this wouldn't make sense. For sensors wrapping other sensors, like SensorAnd or SensorOr, it depends on the child sensors if positional information can be returned.
Note: Returning a non-null value does not imply that the sensor actually returns a valid position in the current moment. This will depend on whether the sensor is in matching state or not.
- Returns:
- InfoProvider instance if the sensor is capable of returning information else null
-