Skip to main content

LevelTicksHost

Trait LevelTicksHost 

pub trait LevelTicksHost: LevelHost {
    // Provided methods
    fn schedule_block_tick(
        &mut self,
        _pos: [i32; 3],
        _block: BlockKey,
        _delay: i32,
    ) -> bool { ... }
    fn schedule_fluid_tick(
        &mut self,
        _pos: [i32; 3],
        _fluid: &str,
        _delay: i32,
    ) -> bool { ... }
    fn signal(&self, _pos: [i32; 3], _direction: Direction) -> i32 { ... }
    fn direct_signal(&self, _pos: [i32; 3], _direction: Direction) -> i32 { ... }
    fn direct_signal_to(&self, _pos: [i32; 3]) -> i32 { ... }
    fn best_neighbor_signal(&self, _pos: [i32; 3]) -> i32 { ... }
    fn has_neighbor_signal(&self, _pos: [i32; 3]) -> bool { ... }
}
Expand description

A LevelReader with vanilla’s ScheduledTickAccess. Shape updates cannot write blocks.

Provided Methods§

fn schedule_block_tick( &mut self, _pos: [i32; 3], _block: BlockKey, _delay: i32, ) -> bool

Schedule a block tick through native_schedule_block_tick.

fn schedule_fluid_tick( &mut self, _pos: [i32; 3], _fluid: &str, _delay: i32, ) -> bool

Schedule a fluid tick through native_schedule_fluid_tick.

fn signal(&self, _pos: [i32; 3], _direction: Direction) -> i32

How strongly the block at pos powers its neighbour on the direction side, power it conducts included (SignalGetter.getSignal(pos, direction)), 0 to 15: the game’s own read, mods’ block_signal and should_check_weak_power parts included, as LevelRef::signal reads it. It writes nothing and draws nothing, so it leaves the write it is read in as it was.

fn direct_signal(&self, _pos: [i32; 3], _direction: Direction) -> i32

The strong power alone that the block at pos gives that way (SignalGetter.getDirectSignal(pos, direction)), 0 to 15.

fn direct_signal_to(&self, _pos: [i32; 3]) -> i32

The strongest strong power reaching the block at pos (SignalGetter.getDirectSignalTo).

fn best_neighbor_signal(&self, _pos: [i32; 3]) -> i32

The strongest power reaching the block at pos (SignalGetter.getBestNeighborSignal).

fn has_neighbor_signal(&self, _pos: [i32; 3]) -> bool

Whether any neighbour powers the block at pos (SignalGetter.hasNeighborSignal), asking no side past the first that does.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§