storedInventory

fun storedInventory(name: String, size: Int, persistent: Boolean = false, maxStackSizes: IntArray = IntArray(size) { 64 }, preUpdateHandler: (ItemPreUpdateEvent) -> Unit? = null, postUpdateHandler: (ItemPostUpdateEvent) -> Unit? = null): VirtualInventory

Retrieves a VirtualInventory stored under name or creates a new one using the specified size, maxStackSizes and persistent properties. Then registers the specified postUpdateHandler and preUpdateHandler.

If the inventory is not persistent, it will also be registered as a drop provider, i.e. it's contents will be dropped when the TileEntity is destroyed.

Note that size and maxStackSizes are only used when creating a new inventory, which means that the inventory retrieved may not necessarily be of that size or have those max stack sizes.


fun storedInventory(name: String, size: Int, preUpdateHandler: (ItemPreUpdateEvent) -> Unit? = null, postUpdateHandler: (ItemPostUpdateEvent) -> Unit? = null): VirtualInventory

Retrieves a VirtualInventory stored under name or creates a new one using the specified size. Then registers the specified postUpdateHandler and preUpdateHandler.

The inventory will also be registered as a drop provider, i.e. it's contents will be dropped when the TileEntity is destroyed.

Note that size is only used when creating a new inventory, which means that the inventory retrieved may not necessarily be of that size.