Interface IPollSensorSetting

All Superinterfaces:
IBaseSensor, ISensorSetting
All Known Implementing Classes:
ConstantSensor, EntityInRangeSensor, PlayerHealthSensor, TwitchStreamerSensor, WorldDayLightSensor, WorldGlobalVariableAnalogSensor, WorldGlobalVariableSensor, WorldPlayersInServerSensor, WorldRainingSensor, WorldTicktimeSensor, WorldTimeSensor, WorldWeatherForecaster

public interface IPollSensorSetting extends ISensorSetting
  • Method Details

    • getPollFrequency

      int getPollFrequency(net.minecraft.world.level.block.entity.BlockEntity te)
      The value returned here is the interval between every check in ticks (i.e. how frequently getRedstoneValue(Level, BlockPos, int, String) should be called. Consider increasing the interval when that method is resource-intensive.
      Parameters:
      te - universal sensor
      Returns:
      the interval in ticks between polling operations
    • getRedstoneValue

      int getRedstoneValue(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, int sensorRange, String textBoxText)
      Called regularly by the Universal Sensor block entity to calculate the output redstone value 0-15 of this sensor. When this sensor is digital, just return 0 or 15.
      Parameters:
      level - the world
      pos - the blockpos to test
      sensorRange - range of the sensor, based on the number of Range Upgrades inserted in the Universal Sensor.
      textBoxText - any text typed in the textfield of the Universal Sensor GUI.
      Returns:
      level of the redstone signal that the Universal Sensor block should emit
    • setPlayerContext

      default void setPlayerContext(UUID playerID)
      Called immediately before getRedstoneValue(Level, BlockPos, int, String) to set up the player context, if necessary. If this sensor doesn't care about player context, there's no need to override this.
      Parameters:
      playerID - unique ID for the player who placed down the calling Universal Sensor