level->setBlock($this, $this, true, false, true); } public function isBreakable(Item $item){ return $this->breakable; } public function onBreak(Item $item){ return $this->level->setBlock($this, new Air(), true, false, true); } public function onUpdate($type){ if($this->hasPhysics === true and $type === Level::BLOCK_UPDATE_NORMAL){ $down = $this->getSide(0); if($down->getID() === self::AIR or ($down instanceof Liquid)){ $data = array( "x" => $this->x + 0.5, "y" => $this->y + 0.5, "z" => $this->z + 0.5, "Tile" => $this->id, ); $server = Server::getInstance(); $this->level->setBlock($this, new Air(), false, false, true); //TODO //$e = $server->api->entity->add($this->level, ENTITY_FALLING, FALLING_SAND, $data); //$e->spawnToAll(); $server->api->block->blockUpdateAround(clone $this, Level::BLOCK_UPDATE_NORMAL, 1); } return false; } return false; } public function onActivate(Item $item, PocketMine\Player $player = null){ return $this->isActivable; } }