public function getWindowId(Inventory $inventory) : int { if ($this->windows->contains($inventory)) { return $this->windows[$inventory]; } return -1; }
public function onClose(Player $who) { $pk = new ContainerClosePacket(); $pk->windowid = $who->getWindowId($this); $who->dataPacket($pk); parent::onClose($who); }