Added InventoryCloseEvent

This commit is contained in:
Shoghi Cervantes
2014-05-27 01:30:24 +02:00
parent 6fcd5322d0
commit e1ccd7f9ea
3 changed files with 59 additions and 1 deletions

View File

@ -25,6 +25,7 @@ use pocketmine\block\Block;
use pocketmine\command\CommandSender;
use pocketmine\entity\DroppedItem;
use pocketmine\entity\Human;
use pocketmine\event\inventory\InventoryCloseEvent;
use pocketmine\event\player\PlayerAchievementAwardedEvent;
use pocketmine\event\player\PlayerChatEvent;
use pocketmine\event\player\PlayerCommandPreprocessEvent;
@ -1986,6 +1987,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
break;
}
if(isset($this->windowIndex[$packet->windowid])){
$this->server->getPluginManager()->callEvent(new InventoryCloseEvent($this->windowIndex[$packet->windowid], $this));
$this->removeWindow($this->windowIndex[$packet->windowid]);
}else{
unset($this->windowIndex[$packet->windowid]);