ICraftingInventory

Link to icraftinginventory

The ICraftingInventory contains all kinds of information on the inventory a crafting process is performed in.

Diese Klasse importieren

Link to diese-klasse-importieren

It might be required to import the class to avoid errors.
import crafttweaker.recipes.ICraftingInventory

ZenGetterRückgabetypBeschreibung
ZenGetter
player
Rückgabetyp
IPlayer
Beschreibung
the player owning this inventory
ZenGetter
size
Rückgabetyp
int
Beschreibung
the inventory's size
ZenGetter
width
Rückgabetyp
int
Beschreibung
the inventory's width
ZenGetter
height
Rückgabetyp
int
Beschreibung
the inventory's height
ZenGetter
stackCount
Rückgabetyp
int
Beschreibung
the the number of stacks that are actually filled in
ZenGetter
items
Rückgabetyp
IItemStack[][]
Beschreibung
The items that present in the crafting table
ZenGetter
itemArray
Rückgabetyp
IItemStack[]
Beschreibung
The items that present in the crafting table

Following Methods are available:

inventory.getStack(index) returns the IItemStack at the given index or null if no item present. Index is an int.
inventory.setStack(index, item) sets the Stack at the given index to the provided item. Index is an int, item is an IItemStack. Use null if you want to clear the stack at that index.

The top left stack is position (0, 0), row and column are ints.
inventory.getStack(row, column) returns the IItemStack at the given position or null if no item present.
inventory.setStack(row, column, item) sets the stack at the given position to the provided item. Item is an IItemStack. Use null if you want to clear the stack at that position.