Beispiel #1
0
 public function onUpdate($type)
 {
     parent::onUpdate($type);
     $faces = [1 => 0, 2 => 3, 3 => 2, 4 => 5, 5 => 4];
     if ($type === Level::BLOCK_UPDATE_NORMAL) {
         if ($this->getSide($faces[$this->meta])->getId() === self::AIR) {
             $this->getLevel()->useBreakOn($this);
             return Level::BLOCK_UPDATE_NORMAL;
         }
     }
     return false;
 }
Beispiel #2
0
 public function onUpdate($type)
 {
     $this->downSideId = $this->getSide(0)->getId();
     return parent::onUpdate($type);
 }