PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
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 
25 namespace pocketmine\inventory;
26 
29 
30 interface Inventory{
31  const MAX_STACK = 64;
32 
33  public function getSize();
34 
35  public function getMaxStackSize();
36 
40  public function setMaxStackSize($size);
41 
42  public function getName();
43 
44  public function getTitle();
45 
51  public function getItem($index);
52 
64  public function setItem($index, Item $item, $source = null);
65 
76  public function addItem(...$slots);
77 
85  public function canAddItem(Item $item);
86 
95  public function removeItem(...$slots);
96 
100  public function getContents();
101 
105  public function setContents(array $items);
106 
110  public function sendContents($target);
111 
116  public function sendSlot($index, $target);
117 
126  public function contains(Item $item);
127 
136  public function all(Item $item);
137 
146  public function first(Item $item);
147 
153  public function firstEmpty();
154 
160  public function remove(Item $item);
161 
170  public function clear($index, $source = null);
171 
175  public function clearAll();
176 
185  public function getViewers($source = null);
186 
190  public function getType();
191 
195  public function getHolder();
196 
200  public function onOpen(Player $who);
201 
209  public function open(Player $who);
210 
211  public function close(Player $who);
212 
216  public function onClose(Player $who);
217 
223  public function onSlotChange($index, $before, $source = null);
224 }
clear($index, $source=null)
onSlotChange($index, $before, $source=null)
setItem($index, Item $item, $source=null)