Contents
Class SensorLeash
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.SensorBase
com.hypixel.hytale.server.npc.corecomponents.world.SensorLeash
- All Implemented Interfaces:
RoleStateChange, Sensor, IAnnotatedComponent, IComponentExecutionControl
A sensor that triggers when the NPC is outside a specified range from the leash point
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSensorLeash(BuilderSensorLeash builderSensorLeash, BuilderSupport builderSupport) -
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
-
SensorLeash
public SensorLeash(@Nonnull BuilderSensorLeash builderSensorLeash, @Nonnull BuilderSupport builderSupport)
-
-
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
-