/** * @param Entity $projectile */ public function setProjectile(Entity $projectile) { if ($projectile !== $this->projectile) { if (count($this->projectile->getViewers()) === 0) { $this->projectile->kill(); $this->projectile->close(); } $this->projectile = $projectile; } }
public function spawnTo(Player $player) { $pk = $this->addEntityDataPacket($player); $pk->type = self::NETWORK_ID; $player->dataPacket($pk); parent::spawnTo($player); }
public function spawnTo(Player $player) { $pk = $this->addEntityDataPacket($player); $pk->type = FishingHook::NETWORK_ID; $pk->owner = $this->shootingEntity; $player->dataPacket($pk); parent::spawnTo($player); }