Trait oc2_hlapi::device::BlockOperationsInterface

source ·
pub trait BlockOperationsInterface: RpcDevice {
    // Required methods
    fn excavate(&self, side: Direction) -> Result<bool>;
    fn place(&self, side: Direction) -> Result<bool>;
    fn durability(&self) -> Result<i32>;
    fn repair(&self) -> Result<bool>;
}
Expand description

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

Required Methods§

source

fn excavate(&self, side: Direction) -> Result<bool>

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>

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

source

fn durability(&self) -> Result<i32>

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

source

fn repair(&self) -> Result<bool>

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.

Object Safety§

This trait is not object safe.

Implementors§