pocketmine\level\generator\object\BigTree::canPlaceObject PHP Метод

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

public canPlaceObject ( pocketmine\level\ChunkManager $level, $x, $y, $z, Random $random )
$level pocketmine\level\ChunkManager
$random pocketmine\utils\Random
    public function canPlaceObject(ChunkManager $level, $x, $y, $z, Random $random)
    {
        if (!parent::canPlaceObject($level, $x, $y, $z, $random) or $level->getBlockIdAt($x, $y, $z) == Block::WATER or $level->getBlockIdAt($x, $y, $z) == Block::STILL_WATER) {
            return false;
        }
        $base = new Vector3($x, $y, $z);
        $this->totalHeight = $this->baseHeight + $random->nextBoundedInt(12);
        $availableSpace = $this->getAvailableBlockSpace($level, $base, $base->add(0, $this->totalHeight - 1, 0));
        if ($availableSpace > $this->baseHeight or $availableSpace == -1) {
            if ($availableSpace != -1) {
                $this->totalHeight = $availableSpace;
            }
            return true;
        }
        return false;
    }