Class PlayerAttackSensor
java.lang.Object
me.desht.pneumaticcraft.common.sensor.eventSensors.PlayerAttackSensor
- All Implemented Interfaces:
IBaseSensor,IEventSensorSetting,ISensorSetting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintemitRedstoneOnEvent(net.minecraftforge.event.entity.player.PlayerEvent event, net.minecraft.world.level.block.entity.BlockEntity sensor, int range) intemitRedstoneOnEvent(net.minecraftforge.eventbus.api.Event event, net.minecraft.world.level.block.entity.BlockEntity sensor, int range, String textboxText) This method is called when a Forge event of interest is triggered.intHow long should an emitted pulse last for? 5 ticks is a suitable value.Return 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, strictComboBoxMethods inherited from interface me.desht.pneumaticcraft.api.universal_sensor.ISensorSetting
getAirUsage, needsGPSTool, notifyTextChange
-
Constructor Details
-
PlayerAttackSensor
public PlayerAttackSensor()
-
-
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
-
needsTextBox
public boolean needsTextBox()Description copied from interface:IBaseSensorShould 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
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
-
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:IEventSensorSettingThis method is called when a Forge event of interest is triggered. Events of interest are:PlayerInteractEventEntityItemPickupEventAttackEntityEvent
- Specified by:
emitRedstoneOnEventin interfaceIEventSensorSetting- Parameters:
event- the Forge event (one of PlayerInteractEvent, EntityItemPickupEvent or AttackEntityEvent)sensor- the Universal Sensor block entityrange- the Universal Sensor's range, in blockstextboxText- 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:IEventSensorSettingHow long should an emitted pulse last for? 5 ticks is a suitable value.- Specified by:
getRedstonePulseLengthin interfaceIEventSensorSetting- Returns:
- a redstone pulse length, in ticks
-