/**
  * @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);
 }