Skip to main content

SignalGetter

Trait SignalGetter 

Source
pub trait SignalGetter: LevelReader {
    // Required methods
    fn is_redstone_conductor(&self, state: BlockStateId, pos: BlockPos) -> bool;
    fn get_direct_signal(&self, pos: BlockPos, direction: Direction) -> i32;
    fn get_direct_signal_to(&self, pos: BlockPos) -> i32;
    fn get_control_input_signal(
        &self,
        pos: BlockPos,
        direction: Direction,
        only_diodes: bool,
    ) -> i32;
    fn has_signal(&self, pos: BlockPos, direction: Direction) -> bool;
    fn get_signal(&self, pos: BlockPos, direction: Direction) -> i32;
    fn get_best_own_or_neighbour_signal(&self, pos: BlockPos) -> i32;
    fn has_neighbor_signal(&self, pos: BlockPos) -> bool;
    fn get_best_neighbor_signal(&self, pos: BlockPos) -> i32;
}
Expand description

Read-only redstone signal queries matching vanilla SignalGetter.

Required Methods§

Source

fn is_redstone_conductor(&self, state: BlockStateId, pos: BlockPos) -> bool

Returns whether state conducts direct power at this level position.

Source

fn get_direct_signal(&self, pos: BlockPos, direction: Direction) -> i32

Returns the direct signal emitted by the block at pos toward direction.

Source

fn get_direct_signal_to(&self, pos: BlockPos) -> i32

Returns the strongest direct signal entering pos from its six neighbors.

Source

fn get_control_input_signal( &self, pos: BlockPos, direction: Direction, only_diodes: bool, ) -> i32

Returns the side input used by vanilla diode blocks.

Source

fn has_signal(&self, pos: BlockPos, direction: Direction) -> bool

Returns whether the block at pos supplies a signal toward direction.

Source

fn get_signal(&self, pos: BlockPos, direction: Direction) -> i32

Returns the signal supplied by the block at pos toward direction.

Source

fn get_best_own_or_neighbour_signal(&self, pos: BlockPos) -> i32

Returns the strongest signal at pos, including the block’s own source value.

Source

fn has_neighbor_signal(&self, pos: BlockPos) -> bool

Returns whether any of the six neighbors supplies signal to pos.

Source

fn get_best_neighbor_signal(&self, pos: BlockPos) -> i32

Returns the strongest signal supplied to pos by its six neighbors.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§