Trait oc2_hlapi::device::ItemHandlerInterface
source · pub trait ItemHandlerInterface: RpcDevice {
// Required methods
fn get_item_slot_count(&self) -> Result<i32>;
fn get_item_slot_limit(&self, slot: i32) -> Result<i32>;
fn get_item_stack_in_slot<T: DeserializeOwned>(
&self,
slot: i32,
) -> Result<T>;
}Expand description
An interface between item storage devices or blocks and the HLAPI.
Required Methods§
sourcefn get_item_slot_count(&self) -> Result<i32>
fn get_item_slot_count(&self) -> Result<i32>
Returns a signed 32-bit integer that represents the slots in the storage block.
sourcefn get_item_slot_limit(&self, slot: i32) -> Result<i32>
fn get_item_slot_limit(&self, slot: i32) -> Result<i32>
Returns a signed 32-bit integer that represents how many items can be stored in a single slot in the storage block.
sourcefn get_item_stack_in_slot<T: DeserializeOwned>(&self, slot: i32) -> Result<T>
fn get_item_stack_in_slot<T: DeserializeOwned>(&self, slot: i32) -> Result<T>
Returns a type which can be deserialized from JSON which represents the current Minecraft IItemStack in the specified slot.
Object Safety§
This trait is not object safe.