/** * @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 close() { parent::close(); if ($this->owner instanceof Player) { $this->owner->fishingHook = null; } }