pub struct InventoryController(pub Address);Expand description
The inventory_controller component (24 methods).
Provided by OpenComputers’ UpgradeInventoryController$Adapter, UpgradeInventoryController$Drone, UpgradeInventoryController$Robot.
Tuple Fields§
§0: AddressImplementations§
Source§impl InventoryController
impl InventoryController
Sourcepub fn are_stacks_equivalent(
&self,
side: impl Into<Number>,
slot_a: impl Into<Number>,
slot_b: impl Into<Number>,
) -> Result<bool>
pub fn are_stacks_equivalent( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, ) -> Result<bool>
Get whether the items in the two specified slots of the inventory on the specified side of the device are equivalent (have shared item tags).
Lua: inventory_controller.areStacksEquivalent(side:number, slotA:number, slotB:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn are_stacks_equivalent_async(
&self,
side: impl Into<Number>,
slot_a: impl Into<Number>,
slot_b: impl Into<Number>,
) -> Result<bool>
pub async fn are_stacks_equivalent_async( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, ) -> Result<bool>
Self::are_stacks_equivalent without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn compare_stack_to_database(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
check_nbt: Option<bool>,
) -> Result<bool>
pub fn compare_stack_to_database( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>
Compare an item in the specified slot in the inventory on the specified side with one in the database with the specified address.
Lua: inventory_controller.compareStackToDatabase(side:number, slot:number, dbAddress:string, dbSlot:number[, checkNBT:boolean=false]):boolean
Indirect call: waits for the next server tick.
check_nbt defaults to false.
Sourcepub async fn compare_stack_to_database_async(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
check_nbt: Option<bool>,
) -> Result<bool>
pub async fn compare_stack_to_database_async( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>
Self::compare_stack_to_database without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn compare_stacks(
&self,
side: impl Into<Number>,
slot_a: impl Into<Number>,
slot_b: impl Into<Number>,
check_nbt: Option<bool>,
) -> Result<bool>
pub fn compare_stacks( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>
Get whether the items in the two specified slots of the inventory on the specified side of the device are of the same type.
Lua: inventory_controller.compareStacks(side:number, slotA:number, slotB:number[, checkNBT:boolean=false]):boolean
Indirect call: waits for the next server tick.
check_nbt defaults to false.
Sourcepub async fn compare_stacks_async(
&self,
side: impl Into<Number>,
slot_a: impl Into<Number>,
slot_b: impl Into<Number>,
check_nbt: Option<bool>,
) -> Result<bool>
pub async fn compare_stacks_async( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>
Self::compare_stacks without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn compare_to_database(
&self,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
check_nbt: Option<bool>,
) -> Result<bool>
pub fn compare_to_database( &self, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>
Compare an item in the specified slot with one in the database with the specified address.
Lua: inventory_controller.compareToDatabase(slot:number, dbAddress:string, dbSlot:number[, checkNBT:boolean=false]):boolean
Indirect call: waits for the next server tick.
check_nbt defaults to false.
Sourcepub async fn compare_to_database_async(
&self,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
check_nbt: Option<bool>,
) -> Result<bool>
pub async fn compare_to_database_async( &self, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>
Self::compare_to_database without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn drop_into_item_inventory(
&self,
inventory_slot: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
) -> Result<Number>
pub fn drop_into_item_inventory( &self, inventory_slot: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, ) -> Result<Number>
Drops an item from the selected slot into the specified slot in the item inventory.
Lua: inventory_controller.dropIntoItemInventory(inventorySlot:number, slot:number[, count:number=64]):number
Indirect call: waits for the next server tick.
count defaults to 64.
Sourcepub async fn drop_into_item_inventory_async(
&self,
inventory_slot: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
) -> Result<Number>
pub async fn drop_into_item_inventory_async( &self, inventory_slot: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, ) -> Result<Number>
Self::drop_into_item_inventory without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn drop_into_slot(
&self,
facing: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
from_side: Option<Number>,
) -> Result<bool>
pub fn drop_into_slot( &self, facing: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, from_side: Option<Number>, ) -> Result<bool>
Drops the selected item stack into the specified slot of an inventory.
Lua: inventory_controller.dropIntoSlot(facing:number, slot:number[, count:number[, fromSide:number]]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn drop_into_slot_async(
&self,
facing: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
from_side: Option<Number>,
) -> Result<bool>
pub async fn drop_into_slot_async( &self, facing: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, from_side: Option<Number>, ) -> Result<bool>
Self::drop_into_slot without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn equip(&self) -> Result<bool>
pub fn equip(&self) -> Result<bool>
Swaps the equipped tool with the content of the currently selected inventory slot.
Lua: inventory_controller.equip():boolean
Indirect call: waits for the next server tick.
Sourcepub async fn equip_async(&self) -> Result<bool>
pub async fn equip_async(&self) -> Result<bool>
Self::equip without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_all_stacks(&self, side: impl Into<Number>) -> Result<Handle>
pub fn get_all_stacks(&self, side: impl Into<Number>) -> Result<Handle>
Get a description of all stacks in the inventory on the specified side of the device.
Lua: inventory_controller.getAllStacks(side:number):userdata
Indirect call: waits for the next server tick.
Sourcepub async fn get_all_stacks_async(
&self,
side: impl Into<Number>,
) -> Result<Handle>
pub async fn get_all_stacks_async( &self, side: impl Into<Number>, ) -> Result<Handle>
Self::get_all_stacks without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_inventory_name(&self, side: impl Into<Number>) -> Result<OcString>
pub fn get_inventory_name(&self, side: impl Into<Number>) -> Result<OcString>
Get the name of the inventory on the specified side of the device.
Lua: inventory_controller.getInventoryName(side:number):string
Indirect call: waits for the next server tick.
Sourcepub async fn get_inventory_name_async(
&self,
side: impl Into<Number>,
) -> Result<OcString>
pub async fn get_inventory_name_async( &self, side: impl Into<Number>, ) -> Result<OcString>
Self::get_inventory_name without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_inventory_size(&self, side: impl Into<Number>) -> Result<Number>
pub fn get_inventory_size(&self, side: impl Into<Number>) -> Result<Number>
Get the number of slots in the inventory on the specified side of the device.
Lua: inventory_controller.getInventorySize(side:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn get_inventory_size_async(
&self,
side: impl Into<Number>,
) -> Result<Number>
pub async fn get_inventory_size_async( &self, side: impl Into<Number>, ) -> Result<Number>
Self::get_inventory_size without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_item_inventory_size(&self, slot: impl Into<Number>) -> Result<Number>
pub fn get_item_inventory_size(&self, slot: impl Into<Number>) -> Result<Number>
The size of an item inventory in the specified slot.
Lua: inventory_controller.getItemInventorySize(slot:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn get_item_inventory_size_async(
&self,
slot: impl Into<Number>,
) -> Result<Number>
pub async fn get_item_inventory_size_async( &self, slot: impl Into<Number>, ) -> Result<Number>
Self::get_item_inventory_size without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_slot_max_stack_size(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
) -> Result<Number>
pub fn get_slot_max_stack_size( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>
Get the maximum number of items in the specified slot of the inventory on the specified side of the device.
Lua: inventory_controller.getSlotMaxStackSize(side:number, slot:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn get_slot_max_stack_size_async(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
) -> Result<Number>
pub async fn get_slot_max_stack_size_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>
Self::get_slot_max_stack_size without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_slot_stack_size(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
) -> Result<Number>
pub fn get_slot_stack_size( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>
Get number of items in the specified slot of the inventory on the specified side of the device.
Lua: inventory_controller.getSlotStackSize(side:number, slot:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn get_slot_stack_size_async(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
) -> Result<Number>
pub async fn get_slot_stack_size_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>
Self::get_slot_stack_size without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_stack_in_internal_slot(&self, slot: Option<Number>) -> Result<Value>
pub fn get_stack_in_internal_slot(&self, slot: Option<Number>) -> Result<Value>
Get a description of the stack in the specified slot or the selected slot.
Lua: inventory_controller.getStackInInternalSlot([slot:number]):table
Indirect call: waits for the next server tick.
Sourcepub async fn get_stack_in_internal_slot_async(
&self,
slot: Option<Number>,
) -> Result<Value>
pub async fn get_stack_in_internal_slot_async( &self, slot: Option<Number>, ) -> Result<Value>
Self::get_stack_in_internal_slot without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_stack_in_slot(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
) -> Result<Value>
pub fn get_stack_in_slot( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Value>
Get a description of the stack in the inventory on the specified side of the device.
Lua: inventory_controller.getStackInSlot(side:number, slot:number):table
Indirect call: waits for the next server tick.
Sourcepub async fn get_stack_in_slot_async(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
) -> Result<Value>
pub async fn get_stack_in_slot_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Value>
Self::get_stack_in_slot without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_upgrade_container_tier(
&self,
slot: impl Into<Number>,
) -> Result<Number>
pub fn get_upgrade_container_tier( &self, slot: impl Into<Number>, ) -> Result<Number>
get upgrade container tier at the given slot.
Lua: inventory_controller.getUpgradeContainerTier(slot:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn get_upgrade_container_tier_async(
&self,
slot: impl Into<Number>,
) -> Result<Number>
pub async fn get_upgrade_container_tier_async( &self, slot: impl Into<Number>, ) -> Result<Number>
Self::get_upgrade_container_tier without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_upgrade_container_type(
&self,
slot: impl Into<Number>,
) -> Result<OcString>
pub fn get_upgrade_container_type( &self, slot: impl Into<Number>, ) -> Result<OcString>
get upgrade container type at the given slot.
Lua: inventory_controller.getUpgradeContainerType(slot:number):string
Indirect call: waits for the next server tick.
Sourcepub async fn get_upgrade_container_type_async(
&self,
slot: impl Into<Number>,
) -> Result<OcString>
pub async fn get_upgrade_container_type_async( &self, slot: impl Into<Number>, ) -> Result<OcString>
Self::get_upgrade_container_type without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn install_upgrade(&self, slot: Option<Number>) -> Result<bool>
pub fn install_upgrade(&self, slot: Option<Number>) -> Result<bool>
Swaps the installed upgrade in the slot (1 by default) with the content of the currently selected inventory slot.
Lua: inventory_controller.installUpgrade([slot:number]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn install_upgrade_async(&self, slot: Option<Number>) -> Result<bool>
pub async fn install_upgrade_async(&self, slot: Option<Number>) -> Result<bool>
Self::install_upgrade without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_equivalent_to(&self, other_slot: impl Into<Number>) -> Result<bool>
pub fn is_equivalent_to(&self, other_slot: impl Into<Number>) -> Result<bool>
Get whether the stack in the selected slot is equivalent to the item in the specified slot (have shared OreDictionary IDs).
Lua: inventory_controller.isEquivalentTo(otherSlot:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn is_equivalent_to_async(
&self,
other_slot: impl Into<Number>,
) -> Result<bool>
pub async fn is_equivalent_to_async( &self, other_slot: impl Into<Number>, ) -> Result<bool>
Self::is_equivalent_to without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_stack_display_name(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
label: impl AsRef<[u8]>,
) -> Result<bool>
pub fn set_stack_display_name( &self, side: impl Into<Number>, slot: impl Into<Number>, label: impl AsRef<[u8]>, ) -> Result<bool>
Change the display name of the stack.
Lua: inventory_controller.setStackDisplayName(side:number, slot:number, label:string):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn set_stack_display_name_async(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
label: impl AsRef<[u8]>,
) -> Result<bool>
pub async fn set_stack_display_name_async( &self, side: impl Into<Number>, slot: impl Into<Number>, label: impl AsRef<[u8]>, ) -> Result<bool>
Self::set_stack_display_name without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn store(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
) -> Result<bool>
pub fn store( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, ) -> Result<bool>
Store an item stack description in the specified slot of the database with the specified address.
Lua: inventory_controller.store(side:number, slot:number, dbAddress:string, dbSlot:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn store_async(
&self,
side: impl Into<Number>,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
) -> Result<bool>
pub async fn store_async( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, ) -> Result<bool>
Self::store without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn store_internal(
&self,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
) -> Result<bool>
pub fn store_internal( &self, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, ) -> Result<bool>
Store an item stack description in the specified slot of the database with the specified address.
Lua: inventory_controller.storeInternal(slot:number, dbAddress:string, dbSlot:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn store_internal_async(
&self,
slot: impl Into<Number>,
db_address: impl AsRef<[u8]>,
db_slot: impl Into<Number>,
) -> Result<bool>
pub async fn store_internal_async( &self, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, ) -> Result<bool>
Self::store_internal without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn suck_from_item_inventory(
&self,
inventory_slot: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
) -> Result<Number>
pub fn suck_from_item_inventory( &self, inventory_slot: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, ) -> Result<Number>
Sucks an item out of the specified slot in the item inventory.
Lua: inventory_controller.suckFromItemInventory(inventorySlot:number, slot:number[, count:number=64]):number
Indirect call: waits for the next server tick.
count defaults to 64.
Sourcepub async fn suck_from_item_inventory_async(
&self,
inventory_slot: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
) -> Result<Number>
pub async fn suck_from_item_inventory_async( &self, inventory_slot: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, ) -> Result<Number>
Self::suck_from_item_inventory without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn suck_from_slot(
&self,
facing: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
from_side: Option<Number>,
) -> Result<bool>
pub fn suck_from_slot( &self, facing: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, from_side: Option<Number>, ) -> Result<bool>
Sucks items from the specified slot of an inventory.
Lua: inventory_controller.suckFromSlot(facing:number, slot:number[, count:number[, fromSide:number]]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn suck_from_slot_async(
&self,
facing: impl Into<Number>,
slot: impl Into<Number>,
count: Option<Number>,
from_side: Option<Number>,
) -> Result<bool>
pub async fn suck_from_slot_async( &self, facing: impl Into<Number>, slot: impl Into<Number>, count: Option<Number>, from_side: Option<Number>, ) -> Result<bool>
Self::suck_from_slot without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Trait Implementations§
Source§impl Clone for InventoryController
impl Clone for InventoryController
Source§impl Component for InventoryController
impl Component for InventoryController
Source§const KIND: &'static str = "inventory_controller"
const KIND: &'static str = "inventory_controller"
"gpu".Source§fn from_address(address: Address) -> Self
fn from_address(address: Address) -> Self
fn address(&self) -> &Address
Source§fn at(address: impl Into<Address>) -> Option<Self>
fn at(address: impl Into<Address>) -> Option<Self>
address, if it is of this type.Source§fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
Source§fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
Component::invoke without blocking; see invoke_async.