Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
component:inventory_controller [2015/04/05 15:37]
rashy Added missing functions.
component:inventory_controller [2017/01/09 10:58]
draco_nite someone make this look pretty
Line 12: Line 12:
  
 - `getInventorySize(side:​ number): number or nil[, string]`  ​ - `getInventorySize(side:​ number): number or nil[, string]`  ​
-Returns the size of the inventory at the specified side.  +Returns the size of the inventory at the specified side.
 **side** - must be a valid side.  ​ **side** - must be a valid side.  ​
 **Returns:​** the size of the inventory, or `nil` followed by a description why this function failed (usually `no inventory`). **Returns:​** the size of the inventory, or `nil` followed by a description why this function failed (usually `no inventory`).
 - `getStackInSlot(side:​number,​ slot:​number):​table`  ​ - `getStackInSlot(side:​number,​ slot:​number):​table`  ​
-Returns a table describing the item in the specified slot or nil.  ​+ 
 +**//__YOU DON'T NEED THE SIDE ARGUMENT WHEN YOUR USING AN ADAPTER WITH AN INVENTORY UPGRADE 
 + 
 +WHOEVER WROTE THIS ARTICLE NEEDS TO FUCKING WRITE IT FOR EVERY SINGLE COMPONENT THAT CAN USE THIS UPGRADE GOD DAMMIT__//​** 
 + 
 +Returns a table describing the item in the specified slot or nil. Deprecated for getting info about robot'​s own inventory, see `getStackInInternalSlot`.  ​
 **side** - must be a valid side.  ​ **side** - must be a valid side.  ​
 **slot** - the slot to analyze. This does not check the inventory size and will consider slots outside the inventory bounds to be empty.  ​ **slot** - the slot to analyze. This does not check the inventory size and will consider slots outside the inventory bounds to be empty.  ​
Line 27: Line 32:
   - **name**:​string - the **untranslated** item name, which is an internal Minecraft value like `oc:​item.FloppyDisk`   - **name**:​string - the **untranslated** item name, which is an internal Minecraft value like `oc:​item.FloppyDisk`
   - **hasTag**:​boolean - whether or not the item has an NBT tag associated with it.   - **hasTag**:​boolean - whether or not the item has an NBT tag associated with it.
 +- `getStackInInternalSlot(slot:​number):​table`  ​
 +  Gets Itemstack description of item in specified or selected slot (if no input provided) of robot inventory.
 - `dropIntoSlot(side:​number,​ slot:​number[,​ count:​number]):​boolean[,​ string]`  ​ - `dropIntoSlot(side:​number,​ slot:​number[,​ count:​number]):​boolean[,​ string]`  ​
 Puts up to count items from the currently selected slot into the specified slot of the inventory at the specified side.  ​ Puts up to count items from the currently selected slot into the specified slot of the inventory at the specified side.  ​
Line 58: Line 65:
 - `getSlotStackSize(side:​number,​ slot:​number):​number`  ​ - `getSlotStackSize(side:​number,​ slot:​number):​number`  ​
   Gets number of items in specified slot in inventory on the specified side.   Gets number of items in specified slot in inventory on the specified side.
-- `getStackInInternalSlot(slot:​number):​table` ​  +
-  Gets Itemstack description of item in specified or selected slot (if no input provided) or robot inventory.+
  
 Example: Example:
Line 70: Line 76:
    
 local slot = 1 local slot = 1
-local item = component.inventory_controller.getStackInSlot(sides.back, ​slot)+local item = component.inventory_controller.getStackInInternalSlot(slot)
    
 if item then if item then