public function onOpen(Player $who)
{
$this->viewers[spl_object_hash($who)] = $who;
}
public function onOpen(Player $who) { parent::onOpen($who); $pk = new ContainerOpenPacket(); $pk->windowid = $who->getWindowId($this); $pk->type = $this->getType()->getNetworkType(); $pk->slots = $this->getSize(); if ($this->holder instanceof Vector3) { $pk->x = $this->holder->getX(); $pk->y = $this->holder->getY(); $pk->z = $this->holder->getZ(); } else { $pk->x = $pk->y = $pk->z = 0; } $who->dataPacket($pk); $this->sendContents($who); }