BlockOperationsInterface

Trait BlockOperationsInterface 

Source
pub trait BlockOperationsInterface: RpcDevice {
    // Required methods
    fn excavate(&self, side: Direction) -> Result<bool>
       where bool: DeserializeOwned + 'static;
    fn place(&self, side: Direction) -> Result<bool>
       where bool: DeserializeOwned + 'static;
    fn durability(&self) -> Result<i32>
       where i32: DeserializeOwned + 'static;
    fn repair(&self) -> Result<bool>
       where bool: DeserializeOwned + 'static;
}
Expand description

An interface between devices which carry out block operations and the HLAPI

Required Methods§

Source

fn excavate(&self, side: Direction) -> Result<bool>
where bool: DeserializeOwned + 'static,

Mines the adjacent block on the given side. Returns true if the block was able to be mined.

Source

fn place(&self, side: Direction) -> Result<bool>
where bool: DeserializeOwned + 'static,

Places a block on the given side. Returns true if the block was able to be placed.

Source

fn durability(&self) -> Result<i32>
where i32: DeserializeOwned + 'static,

Returns a 32-bit signed integer that represents the durability of the currently active tool

Source

fn repair(&self) -> Result<bool>
where bool: DeserializeOwned + 'static,

Attempts to repair the currently active tool, returning true if the tool was repaired. If the tool is at full durability, this will always return false.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§