Class BlockInteractSensor
java.lang.Object
me.desht.pneumaticcraft.common.sensor.eventSensors.BlockInteractSensor
- All Implemented Interfaces:
IBaseSensor,IBlockAndCoordinateEventSensor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintemitRedstoneOnEvent(net.minecraftforge.eventbus.api.Event event, net.minecraft.world.level.block.entity.BlockEntity sensor, int range, Set<net.minecraft.core.BlockPos> positions) Extended version of the normal emitRedstoneOnEvent.intReturn the upgrades required by this sensor.Return the button path the player has to follow in which this setting is stored.booleanShould this sensor's GUI display a text box for extra information to be entered?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.api.universal_sensor.IBaseSensor
getAdditionalInfo, getDescription, getHelpPromptText, getHelpText, getTextboxIntRange, getTextBoxOptions, isEntityFilter, strictComboBox
-
Constructor Details
-
BlockInteractSensor
public BlockInteractSensor()
-
-
Method Details
-
getSensorPath
Description copied from interface:IBaseSensorReturn 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:
getSensorPathin interfaceIBaseSensor- Returns:
- a string path to the sensor
-
getRequiredUpgrades
Description copied from interface:IBaseSensorReturn the upgrades required by this sensor. This will automatically include a GPS Tool for sensors that require a location.- Specified by:
getRequiredUpgradesin interfaceIBaseSensor- Returns:
- a set of upgrades
-
needsTextBox
public boolean needsTextBox()Description copied from interface:IBaseSensorShould this sensor's GUI display a text box for extra information to be entered?- Specified by:
needsTextBoxin interfaceIBaseSensor- 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:IBlockAndCoordinateEventSensorExtended 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:
emitRedstoneOnEventin interfaceIBlockAndCoordinateEventSensor- Parameters:
event- the Forge event (one of PlayerInteractEvent, EntityItemPickupEvent or AttackEntityEvent)sensor- the Universal Sensor block entityrange- the Universal Sensor's range, in blockspositions- 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:
getRedstonePulseLengthin interfaceIBlockAndCoordinateEventSensor- Returns:
- a redstone pulse length, in ticks
-