pocketmine\Player::getWindowId PHP Method

getWindowId() public method

public getWindowId ( pocketmine\inventory\Inventory $inventory ) : integer
$inventory pocketmine\inventory\Inventory
return integer
    public function getWindowId(Inventory $inventory) : int
    {
        if ($this->windows->contains($inventory)) {
            return $this->windows[$inventory];
        }
        return -1;
    }

Usage Example

 public function onClose(Player $who)
 {
     $pk = new ContainerClosePacket();
     $pk->windowid = $who->getWindowId($this);
     $who->dataPacket($pk);
     parent::onClose($who);
 }
All Usage Examples Of pocketmine\Player::getWindowId
Player