java.lang.Object
me.desht.pneumaticcraft.common.sensor.pollSensors.ConstantSensor
All Implemented Interfaces:
IBaseSensor, IPollSensorSetting, ISensorSetting

public class ConstantSensor extends Object implements IPollSensorSetting
  • Constructor Details

    • ConstantSensor

      public ConstantSensor()
  • Method Details

    • getSensorPath

      public String getSensorPath()
      Description copied from interface: IBaseSensor
      Return the button path the player has to follow in which this setting is stored. For instance, when the sensor should be located in player and is called speed, you should return "player/speed".
      Specified by:
      getSensorPath in interface IBaseSensor
      Returns:
      a string path to the sensor
    • getRequiredUpgrades

      public Set<PNCUpgrade> getRequiredUpgrades()
      Description copied from interface: IBaseSensor
      Return the upgrades required by this sensor. This will automatically include a GPS Tool for sensors that require a location.
      Specified by:
      getRequiredUpgrades in interface IBaseSensor
      Returns:
      a set of upgrades
    • getPollFrequency

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

      public boolean needsTextBox()
      Description copied from interface: IBaseSensor
      Should this sensor's GUI display a text box for extra information to be entered?
      Specified by:
      needsTextBox in interface IBaseSensor
      Returns:
      true if this sensor needs a text box, false otherwise
    • getTextboxIntRange

      public RangedInt getTextboxIntRange()
      Description copied from interface: IBaseSensor
      For numeric textboxes (see IBaseSensor.needsTextBox()), get the permitted numeric range.
      Specified by:
      getTextboxIntRange in interface IBaseSensor
      Returns:
      the numeric range, or null if the textbox should allow freeform text
    • getRedstoneValue

      public int getRedstoneValue(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, int sensorRange, String textBoxText)
      Description copied from interface: IPollSensorSetting
      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.
      Specified by:
      getRedstoneValue in interface IPollSensorSetting
      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
    • getAdditionalInfo

      public void getAdditionalInfo(List<net.minecraft.network.chat.Component> info)
      Description copied from interface: IBaseSensor
      Return some descriptive text to be displayed above the optional textbox
      Specified by:
      getAdditionalInfo in interface IBaseSensor
      Parameters:
      info - a text component list to be appended to
    • getAirUsage

      public int getAirUsage(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
      Description copied from interface: ISensorSetting
      Get the air usage for this sensor.
      Specified by:
      getAirUsage in interface ISensorSetting
      Returns:
      the sensor air usage in mL air per tick