onUpdate() public method

public onUpdate ( $currentTick )
 public function onUpdate($currentTick)
 {
     parent::onUpdate($currentTick);
     $this->getLevel()->addParticle(new DustParticle($this->getPosition(), $this->namedtag["r"], $this->namedtag["g"], $this->namedtag["b"]));
     /*if($this->onGround){
     			$this->kill();
     		}*/
 }
Example #2
0
 public function onUpdate($currentTick)
 {
     if ($this->closed) {
         return \false;
     }
     $this->timings->startTiming();
     $hasUpdate = parent::onUpdate($currentTick);
     if (!$this->hadCollision and $this->isCritical) {
         $this->level->addParticle(new CriticalParticle($this->add($this->width / 2 + \mt_rand(-100, 100) / 500, $this->height / 2 + \mt_rand(-100, 100) / 500, $this->width / 2 + \mt_rand(-100, 100) / 500)));
     } elseif ($this->onGround) {
         $this->isCritical = \false;
     }
     if ($this->age > 1200) {
         $this->kill();
         $hasUpdate = \true;
     }
     $this->timings->stopTiming();
     $this->Light($this->width, $this->height, $this->length);
     return $hasUpdate;
 }