public function onClose(Player $who) { $pk = new ContainerClosePacket(); $pk->windowid = $who->getWindowId($this); $who->dataPacket($pk); parent::onClose($who); }
public function send() { $pk = new UpdateAttributePacket(); $pk->maxValue = $this->getMaxValue(); $pk->minValue = $this->getMinValue(); $pk->value = $this->currentValue; $pk->name = $this->getName(); $pk->entityId = 0; $pk->encode(); $this->player->dataPacket($pk); }
public function spawnTo(Player $player) { $pk = new AddPaintingPacket(); $pk->eid = $this->getId(); $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; $pk->direction = $this->getDirection(); $pk->title = $this->motive; $player->dataPacket($pk); parent::spawnTo($player); }
public function spawnTo(Player $player) { if ($this->closed) { return false; } $nbt = new NBT(NBT::LITTLE_ENDIAN); $nbt->setData($this->getSpawnCompound()); $pk = new BlockEntityDataPacket(); $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; $pk->namedtag = $nbt->write(); $player->dataPacket($pk); return true; }
public function despawnFrom(Player $player) { if (isset($this->hasSpawned[$player->getLoaderId()])) { $pk = new RemovePlayerPacket(); $pk->eid = $this->getId(); $pk->clientId = $this->getUniqueId(); $player->dataPacket($pk); unset($this->hasSpawned[$player->getLoaderId()]); } }
public function spawnTo(Player $player) { $pk = new AddItemEntityPacket(); $pk->eid = $this->getId(); $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; $pk->speedX = $this->motionX; $pk->speedY = $this->motionY; $pk->speedZ = $this->motionZ; $pk->item = $this->getItem(); $player->dataPacket($pk); $this->sendData($player); parent::spawnTo($player); }