Class NullSensor

java.lang.Object
com.hypixel.hytale.server.npc.instructions.NullSensor
All Implemented Interfaces:
RoleStateChange, Sensor, IAnnotatedComponent, IComponentExecutionControl

public class NullSensor extends Object implements Sensor
  • Constructor Details

    • NullSensor

      public NullSensor()
  • Method Details

    • matches

      public boolean matches(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, double dt, @Nonnull Store<EntityStore> store)
      Specified by:
      matches in interface Sensor
    • getSensorInfo

      public InfoProvider getSensorInfo()
      Description copied from interface: Sensor
      Get 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.

      Specified by:
      getSensorInfo in interface Sensor
      Returns:
      InfoProvider instance if the sensor is capable of returning information else null
    • processDelay

      public boolean processDelay(float dt)
      Description copied from interface: IComponentExecutionControl
      Tick down the internal delay on this core component
      Specified by:
      processDelay in interface IComponentExecutionControl
      Parameters:
      dt - the tick duration
      Returns:
      whether this component has finished processing its internal delay
    • clearOnce

      public void clearOnce()
      Specified by:
      clearOnce in interface IComponentExecutionControl
    • setOnce

      public void setOnce()
      Specified by:
      setOnce in interface IComponentExecutionControl
    • isTriggered

      public boolean isTriggered()
      Specified by:
      isTriggered in interface IComponentExecutionControl
    • getInfo

      public void getInfo(ExecutionSupport executionSupport, ComponentInfo holder)
      Description copied from interface: IAnnotatedComponent
      Populates the ComponentInfo holder with any relevant information relating to this particular component
      Specified by:
      getInfo in interface IAnnotatedComponent
      Parameters:
      executionSupport - per-execution context
      holder - the ComponentInfo instance to populate
    • setContext

      public void setContext(IAnnotatedComponent parent, int index)
      Specified by:
      setContext in interface IAnnotatedComponent
    • getParent

      @Nullable public IAnnotatedComponent getParent()
      Specified by:
      getParent in interface IAnnotatedComponent
    • getIndex

      public int getIndex()
      Specified by:
      getIndex in interface IAnnotatedComponent