PocketMine-MP 5.33.2 git-1133d49c924b4358c79d44eeb97dcbf56cb4d1eb
Loading...
Searching...
No Matches
Inventory.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
27namespace pocketmine\inventory;
28
33
34interface Inventory{
35 public const MAX_STACK = 64;
36
40 public function getSize() : int;
41
46 public function getMaxStackSize() : int;
47
51 public function setMaxStackSize(int $size) : void;
52
56 public function getItem(int $index) : Item;
57
61 public function setItem(int $index, Item $item) : void;
62
70 public function getContents(bool $includeEmpty = false) : array;
71
79 public function setContents(array $items) : void;
80
90 public function addItem(Item ...$slots) : array;
91
95 public function canAddItem(Item $item) : bool;
96
100 public function getAddableItemQuantity(Item $item) : int;
101
107 public function getMatchingItemCount(int $slot, Item $test, bool $checkTags) : int;
108
116 public function contains(Item $item) : bool;
117
128 public function all(Item $item) : array;
129
136 public function first(Item $item, bool $exact = false) : int;
137
141 public function firstEmpty() : int;
142
146 public function isSlotEmpty(int $index) : bool;
147
154 public function remove(Item $item) : void;
155
165 public function removeItem(Item ...$slots) : array;
166
170 public function clear(int $index) : void;
171
175 public function clearAll() : void;
176
180 public function swap(int $slot1, int $slot2) : void;
181
188 public function getViewers() : array;
189
193 public function removeAllWindows() : void;
194
198 public function onOpen(InventoryWindow $window) : void;
199
200 public function onClose(InventoryWindow $window) : void;
201
205 public function slotExists(int $slot) : bool;
206
211 public function getListeners() : ObjectSet;
212}
onOpen(InventoryWindow $window)
getContents(bool $includeEmpty=false)
setItem(int $index, Item $item)
getMatchingItemCount(int $slot, Item $test, bool $checkTags)
first(Item $item, bool $exact=false)
swap(int $slot1, int $slot2)