/**
  * @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;
     }
 }
Пример #2
0
 public function spawnTo(Player $player)
 {
     $pk = $this->addEntityDataPacket($player);
     $pk->type = self::NETWORK_ID;
     $player->dataPacket($pk);
     parent::spawnTo($player);
 }
Пример #3
0
 public function spawnTo(Player $player)
 {
     $pk = $this->addEntityDataPacket($player);
     $pk->type = FishingHook::NETWORK_ID;
     $pk->owner = $this->shootingEntity;
     $player->dataPacket($pk);
     parent::spawnTo($player);
 }