pub struct BlockOperationsModule(pub String);Expand description
A device capable of manipulating blocks in the world
Tuple Fields§
§0: StringTrait Implementations§
Source§impl BlockOperationsInterface for BlockOperationsModule
impl BlockOperationsInterface for BlockOperationsModule
Source§fn excavate(&self, bus: &mut DeviceBus, side: &str) -> Result<bool>
fn excavate(&self, bus: &mut DeviceBus, side: &str) -> Result<bool>
OC2 Docs:
tries to break a block in the specified direction. Collected blocks will be inserted starting at the currently selected inventory slot. If the selected slot is full, the next slot will be used, and so on. If the inventory has no space for the dropped block, it will drop into the world.
Returns whether the operation was successful.
Source§fn place(&self, bus: &mut DeviceBus, side: &str) -> Result<bool>
fn place(&self, bus: &mut DeviceBus, side: &str) -> Result<bool>
OC2 Docs:
tries to place a block in the specified direction. Blocks will be placed from the currently selected inventory slot. If the slot is empty, no block will be placed.
Returns whether the operation was successful.
Source§fn durability(&self, bus: &mut DeviceBus) -> Result<i32>
fn durability(&self, bus: &mut DeviceBus) -> Result<i32>
OC2 Docs:
returns the remaining durability of the module’s excavation tool. Once the durability has reached zero, no further excavation operations can be performed until it is repaired.
Source§fn repair(&self, bus: &mut DeviceBus) -> Result<bool>
fn repair(&self, bus: &mut DeviceBus) -> Result<bool>
OC2 Docs:
attempts to repair the module’s excavation tool using materials in the currently selected inventory slot. This method will consume one item at a time. Any regular tool may act as the source for repair materials, such as pickaxes and shovels. The quality of the tool directly effects the amount of durability restored.
Returns whether some material could be used to repair the module’s excavation tool.
Auto Trait Implementations§
impl Freeze for BlockOperationsModule
impl RefUnwindSafe for BlockOperationsModule
impl Send for BlockOperationsModule
impl Sync for BlockOperationsModule
impl Unpin for BlockOperationsModule
impl UnsafeUnpin for BlockOperationsModule
impl UnwindSafe for BlockOperationsModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more