Interface InventoryStorage

All Superinterfaces:
Iterable<StorageView<ItemVariant>>, SlottedStorage<ItemVariant>, Storage<ItemVariant>
All Known Subinterfaces:
PlayerInventoryStorage

@NonExtendable public interface InventoryStorage extends SlottedStorage<ItemVariant>
An implementation of Storage<ItemVariant> for vanilla's Inventory, SidedInventory and PlayerInventory.

Inventory is often nicer to implement than Storage<ItemVariant>, but harder to use for item transfer. This wrapper allows one to have the best of both worlds, for example by storing a subclass of SimpleInventory in a block entity class, while exposing it as a Storage<ItemVariant> to the item transfer API.

In particular, note that getSlots() can be combined with CombinedStorage to retrieve a wrapper around a specific range of slots.

Important note: This wrapper assumes that the inventory owns its slots. If the inventory does not own its slots, for example because it delegates to another inventory, this wrapper should not be used!