Class BlockComparatorSensor

java.lang.Object
me.desht.pneumaticcraft.common.sensor.pollSensors.BlockComparatorSensor
All Implemented Interfaces:
IBaseSensor, IBlockAndCoordinatePollSensor

public class BlockComparatorSensor extends Object implements IBlockAndCoordinatePollSensor
  • Constructor Details

    • BlockComparatorSensor

      public BlockComparatorSensor()
  • 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()
      Description copied from interface: IBlockAndCoordinatePollSensor
      Specified by:
      getPollFrequency in interface IBlockAndCoordinatePollSensor
      Returns:
      a poll frequency, in ticks
    • 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
    • getRedstoneValue

      public int getRedstoneValue(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, int sensorRange, String textBoxText, Set<net.minecraft.core.BlockPos> positions)
      Description copied from interface: IBlockAndCoordinatePollSensor
      Similar to IPollSensorSetting.getRedstoneValue(Level, BlockPos, int, String), but this has the GPS tracked coordinates as extra parameters. This method will only invoke with a valid GPS tool, and when all the coordinates are within range.
      Specified by:
      getRedstoneValue in interface IBlockAndCoordinatePollSensor
      Parameters:
      world - the sensor's world
      pos - the sensor's position
      sensorRange - the sensor's current range, based on installed range upgrades
      textBoxText - text in the sensor GUI's textbox (may be an empty string)
      positions - When only one GPS Tool is inserted this contains the position of just that tool. If two GPS Tools are inserted, These are both corners of a box, and every coordinate in this box is added to the positions argument.
      Returns:
      the redstone signal level to be emitted