Interface PlayerInventoryStorage

All Superinterfaces:
InventoryStorage, Iterable<StorageView<ItemVariant>>, Storage<ItemVariant>

@Experimental @NonExtendable public interface PlayerInventoryStorage extends InventoryStorage
A Storage<ItemVariant> implementation for a PlayerInventory. This is a specialized version of InventoryStorage, with an additional transactional wrapper for PlayerInventory.offerOrDrop(net.minecraft.item.ItemStack).

Note that this is a wrapper around all the slots of the player inventory. However, insert(net.fabricmc.fabric.api.transfer.v1.item.ItemVariant, long, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext) is overridden to behave like offer(net.fabricmc.fabric.api.transfer.v1.item.ItemVariant, long, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext). For simple insertions, offer(net.fabricmc.fabric.api.transfer.v1.item.ItemVariant, long, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext) or offerOrDrop(net.fabricmc.fabric.api.transfer.v1.item.ItemVariant, long, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext) is recommended. InventoryStorage.getSlots() can also be used and combined with CombinedStorage to retrieve a wrapper around a specific range of slots.

Experimental feature, we reserve the right to remove or change it without further notice. The transfer API is a complex addition, and we want to be able to correct possible design mistakes.