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§
Sourcefn is_redstone_conductor(&self, state: BlockStateId, pos: BlockPos) -> bool
fn is_redstone_conductor(&self, state: BlockStateId, pos: BlockPos) -> bool
Returns whether state conducts direct power at this level position.
Sourcefn get_direct_signal(&self, pos: BlockPos, direction: Direction) -> i32
fn get_direct_signal(&self, pos: BlockPos, direction: Direction) -> i32
Returns the direct signal emitted by the block at pos toward direction.
Sourcefn get_direct_signal_to(&self, pos: BlockPos) -> i32
fn get_direct_signal_to(&self, pos: BlockPos) -> i32
Returns the strongest direct signal entering pos from its six neighbors.
Sourcefn get_control_input_signal(
&self,
pos: BlockPos,
direction: Direction,
only_diodes: bool,
) -> i32
fn get_control_input_signal( &self, pos: BlockPos, direction: Direction, only_diodes: bool, ) -> i32
Returns the side input used by vanilla diode blocks.
Sourcefn has_signal(&self, pos: BlockPos, direction: Direction) -> bool
fn has_signal(&self, pos: BlockPos, direction: Direction) -> bool
Returns whether the block at pos supplies a signal toward direction.
Sourcefn get_signal(&self, pos: BlockPos, direction: Direction) -> i32
fn get_signal(&self, pos: BlockPos, direction: Direction) -> i32
Returns the signal supplied by the block at pos toward direction.
Sourcefn get_best_own_or_neighbour_signal(&self, pos: BlockPos) -> i32
fn get_best_own_or_neighbour_signal(&self, pos: BlockPos) -> i32
Returns the strongest signal at pos, including the block’s own source value.
Sourcefn has_neighbor_signal(&self, pos: BlockPos) -> bool
fn has_neighbor_signal(&self, pos: BlockPos) -> bool
Returns whether any of the six neighbors supplies signal to pos.
Sourcefn get_best_neighbor_signal(&self, pos: BlockPos) -> i32
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".