pocketmine\entity\ThrownExpBottle::onUpdate PHP Метод

onUpdate() публичный Метод

public onUpdate ( $currentTick )
    public function onUpdate($currentTick)
    {
        if ($this->closed) {
            return false;
        }
        $this->timings->startTiming();
        $hasUpdate = parent::onUpdate($currentTick);
        $this->age++;
        if ($this->age > 1200 or $this->isCollided) {
            $this->kill();
            $this->close();
            $this->getLevel()->addParticle(new SpellParticle($this, 46, 82, 153));
            if ($this->getLevel()->getServer()->expEnabled) {
                $this->getLevel()->spawnXPOrb($this->add(0, -0.2, 0), mt_rand(1, 4));
                $this->getLevel()->spawnXPOrb($this->add(-0.1, -0.2, 0), mt_rand(1, 4));
                $this->getLevel()->spawnXPOrb($this->add(0, -0.2, -0.1), mt_rand(1, 4));
            }
            $hasUpdate = true;
        }
        $this->timings->stopTiming();
        return $hasUpdate;
    }