Class BlockInteractSensor

java.lang.Object
me.desht.pneumaticcraft.common.sensor.eventSensors.BlockInteractSensor
All Implemented Interfaces:
IBaseSensor, IBlockAndCoordinateEventSensor

public class BlockInteractSensor extends Object implements IBlockAndCoordinateEventSensor
  • Constructor Details

    • BlockInteractSensor

      public BlockInteractSensor()
  • 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
    • 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
    • emitRedstoneOnEvent

      public int emitRedstoneOnEvent(net.minecraftforge.eventbus.api.Event event, net.minecraft.world.level.block.entity.BlockEntity sensor, int range, Set<net.minecraft.core.BlockPos> positions)
      Description copied from interface: IBlockAndCoordinateEventSensor
      Extended version of the normal emitRedstoneOnEvent. This method will only invoke with a valid GPS tool, and when all the coordinates are within range.
      Specified by:
      emitRedstoneOnEvent in interface IBlockAndCoordinateEventSensor
      Parameters:
      event - the Forge event (one of PlayerInteractEvent, EntityItemPickupEvent or AttackEntityEvent)
      sensor - the Universal Sensor block entity
      range - the Universal Sensor's range, in blocks
      positions - When a GPS Tool is inserted this contains the position of that tool. If a GPS Area Tool is inserted this is set of all positions in that area.
      Returns:
      the redstone level that should be emitted
    • getRedstonePulseLength

      public int getRedstonePulseLength()
      Description copied from interface: IBlockAndCoordinateEventSensor
      Specified by:
      getRedstonePulseLength in interface IBlockAndCoordinateEventSensor
      Returns:
      a redstone pulse length, in ticks