Interface SignalGetter
- All Superinterfaces:
BlockGetter
- All Known Subinterfaces:
RedstoneWorld
Read access to the blocks of a world and to the redstone signals running through them.
- Since:
- 0.1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintanalogOutput(BlockPosition position, BlockFace direction) Gets the level a comparator reads out of a block.intbestNeighborSignal(BlockPosition position) Returns the strongest signal a block receives from its six neighbours, from0to15.intcontrolInputSignal(BlockPosition position, BlockFace direction, boolean diodesOnly) Gets the signal a block feeds into the side of a repeater or a comparator.intdirectSignal(BlockPosition position, BlockFace direction) Gets the strong signal a block emits towards one of its neighbours, the one that powers a conductor through.intdirectSignalTo(BlockPosition position) Returns the strongest strong signal a block receives from its six neighbours.booleanhasAnalogOutput(BlockPosition position) Returnstrueif a comparator can read a level out of the block, such as how full a container is.booleanhasNeighborSignal(BlockPosition position) Returnstruewhen at least one of the six neighbours of a block powers it, what a door, a lamp or a piston listens to.default booleanhasSignal(BlockPosition position, BlockFace direction) booleanisConductor(BlockPosition position) Returnstrueif the block conducts power: a full, opaque block such as stone, but not glass, glowstone or a block of redstone.booleanisFaceSturdy(BlockPosition position, BlockFace face, SupportType support) Returnstrueif a face of the block can hold a block attached to it.intsignal(BlockPosition position, BlockFace direction) Gets the signal a block powers its neighbour with: the weak signal it emits, or, for a conductor, the strongest strong signal it receives when that is higher.world()Returns the world these signals run in.Methods inherited from interface BlockGetter
blockAt
-
Method Details
-
world
World world()Returns the world these signals run in.- Returns:
- the world these signals run in
- Since:
- 0.1.0
-
signal
Gets the signal a block powers its neighbour with: the weak signal it emits, or, for a conductor, the strongest strong signal it receives when that is higher.- Parameters:
position- the block emitting the signaldirection- the direction from the block reading the signal toposition- Returns:
- the signal, from
0to15 - Since:
- 0.1.0
-
hasSignal
- Parameters:
position- the block emitting the signaldirection- the direction from the block reading the signal toposition- Returns:
trueifsignal(BlockPosition, BlockFace)is above0- Since:
- 0.1.0
-
directSignal
Gets the strong signal a block emits towards one of its neighbours, the one that powers a conductor through.- Parameters:
position- the block emitting the signaldirection- the direction from the block reading the signal toposition- Returns:
- the signal, from
0to15 - Since:
- 0.1.0
-
directSignalTo
Returns the strongest strong signal a block receives from its six neighbours.- Parameters:
position- the block receiving the signals- Returns:
- the strongest strong signal a block receives from its six neighbours
- Since:
- 0.1.0
-
bestNeighborSignal
Returns the strongest signal a block receives from its six neighbours, from0to15.- Parameters:
position- the block receiving the signals- Returns:
- the strongest signal a block receives from its six neighbours, from
0to15 - Since:
- 0.1.0
-
hasNeighborSignal
Returnstruewhen at least one of the six neighbours of a block powers it, what a door, a lamp or a piston listens to.- Parameters:
position- the block receiving the signals- Returns:
truewhen at least one of the six neighbours of a block powers it, what a door, a lamp or a piston listens to- Since:
- 0.1.0
-
controlInputSignal
Gets the signal a block feeds into the side of a repeater or a comparator.- Parameters:
position- the block on the side of the repeater or comparatordirection- the direction from the repeater or comparator topositiondiodesOnly-trueto only accept repeaters and comparators, what locks a repeater- Returns:
- the signal, from
0to15 - Since:
- 0.1.0
-
hasAnalogOutput
Returnstrueif a comparator can read a level out of the block, such as how full a container is.- Parameters:
position- the block to read- Returns:
trueif a comparator can read a level out of the block, such as how full a container is- Since:
- 0.1.0
- See Also:
-
analogOutput
Gets the level a comparator reads out of a block.- Parameters:
position- the block to readdirection- the direction from the comparator toposition- Returns:
- the level, from
0to15,0for a block with no analog output - Since:
- 0.1.0
-
isConductor
Returnstrueif the block conducts power: a full, opaque block such as stone, but not glass, glowstone or a block of redstone.- Parameters:
position- the block- Returns:
trueif the block conducts power: a full, opaque block such as stone, but not glass, glowstone or a block of redstone- Since:
- 0.1.0
-
isFaceSturdy
Returnstrueif a face of the block can hold a block attached to it.- Parameters:
position- the blockface- the face, as seen from the block itself:BlockFace.UPfor its topsupport- how much of the face must be covered- Returns:
trueif a face of the block can hold a block attached to it- Since:
- 0.1.0
-