= to the count of the specified item stack. * * If $exact is true, only items with equal ID, damage, NBT and count will match. */ public function first(Item $item, bool $exact = false) : int; /** * Returns the first empty slot, or -1 if not found */ public function firstEmpty() : int; /** * Returns whether the given slot is empty. */ public function isSlotEmpty(int $index) : bool; /** * Will remove all the Items that has the same id and metadata (if not null) */ public function remove(Item $item) : void; /** * Will clear a specific slot */ public function clear(int $index) : void; /** * Clears all the slots */ public function clearAll() : void; /** * Swaps the specified slots. */ public function swap(int $slot1, int $slot2) : void; /** * Gets all the Players viewing the inventory * Players will view their inventory at all times, even when not open. * * @return Player[] */ public function getViewers() : array; /** * Called when a player opens this inventory. */ public function onOpen(Player $who) : void; public function onClose(Player $who) : void; /** * Returns whether the specified slot exists in the inventory. */ public function slotExists(int $slot) : bool; /** * @param InventoryListener ...$listeners */ public function addListeners(InventoryListener ...$listeners) : void; /** * @param InventoryListener ...$listeners */ public function removeListeners(InventoryListener ...$listeners) : void; public function removeAllListeners() : void; /** * @return InventoryListener[] */ public function getListeners() : array; }