Interface SignalGetter

All Superinterfaces:
BlockGetter, IBlockGetterExtension, LevelHeightAccessor
All Known Subinterfaces:
CommonLevelAccessor, LevelAccessor, LevelReader, LevelTimeAccess, ServerLevelAccessor, WorldGenLevel
All Known Implementing Classes:
ClientLevel, Level, ServerLevel, WorldGenRegion

public interface SignalGetter extends BlockGetter
  • Field Details

    • DIRECTIONS

      static final Direction[] DIRECTIONS
  • Method Details

    • getDirectSignal

      default int getDirectSignal(BlockPos pPos, Direction pDirection)
      Returns the direct redstone signal emitted from the given position in the given direction.

      NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.

    • getDirectSignalTo

      default int getDirectSignalTo(BlockPos pPos)
      Returns the direct redstone signal the given position receives from neighboring blocks.
    • getControlInputSignal

      default int getControlInputSignal(BlockPos pPos, Direction pDirection, boolean pDiodesOnly)
      Returns the control signal emitted from the given position in the given direction. If diodesOnly is true, this method returns the direct signal emitted if and only if this position is occupied by a diode (i.e. a repeater or comparator). Otherwise, if this position is occupied by a redstone block, this method will return the redstone signal emitted by it. If not, this method will return the direct signal emitted from this position in the given direction.

      NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.

    • hasSignal

      default boolean hasSignal(BlockPos pPos, Direction pDirection)
      Returns whether a redstone signal is emitted from the given position in the given direction.

      NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.

    • getSignal

      default int getSignal(BlockPos pPos, Direction pDirection)
      Returns the redstone signal emitted from the given position in the given direction. This is the highest value between the signal emitted by the block itself, and the direct signal received from neighboring blocks if the block is a redstone conductor.

      NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.

    • hasNeighborSignal

      default boolean hasNeighborSignal(BlockPos pPos)
      Returns whether the given position receives any redstone signal from neighboring blocks.
    • getBestNeighborSignal

      default int getBestNeighborSignal(BlockPos pPos)
      Returns the highest redstone signal the given position receives from neighboring blocks.