Class PlayerItemPickupSensor

java.lang.Object
me.desht.pneumaticcraft.common.sensor.eventSensors.PlayerItemPickupSensor
All Implemented Interfaces:
IBaseSensor, IEventSensorSetting, ISensorSetting

public class PlayerItemPickupSensor extends Object
  • Constructor Details

    • PlayerItemPickupSensor

      public PlayerItemPickupSensor()
  • 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
    • needsTextBox

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

      public int emitRedstoneOnEvent(net.minecraftforge.event.entity.player.PlayerEvent event, net.minecraft.world.level.block.entity.BlockEntity sensor, int range)
    • 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
    • emitRedstoneOnEvent

      public int emitRedstoneOnEvent(net.minecraftforge.eventbus.api.Event event, net.minecraft.world.level.block.entity.BlockEntity sensor, int range, String textboxText)
      Description copied from interface: IEventSensorSetting
      This method is called when a Forge event of interest is triggered. Events of interest are:
      • PlayerInteractEvent
      • EntityItemPickupEvent
      • AttackEntityEvent
      Specified by:
      emitRedstoneOnEvent in interface IEventSensorSetting
      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
      textboxText - any text which was entered in the sensor configuration's textfield
      Returns:
      the redstone strength which should be emitted
    • getRedstonePulseLength

      public int getRedstonePulseLength()
      Description copied from interface: IEventSensorSetting
      How long should an emitted pulse last for? 5 ticks is a suitable value.
      Specified by:
      getRedstonePulseLength in interface IEventSensorSetting
      Returns:
      a redstone pulse length, in ticks