function p.__get_is_solid() return false end
function p.__get_tex() return "" end

--The "depth" variable of the block
--determines how many trees it has.
function p.__main()
    set_default_block("e")

    --Ground.
    create_rect("forest", 0,0,0, 15,15,0)

    --Shrink and grow
    add_bent(8,7,3, "bent_base_ring_green")
    set_pos(6,7,3, "r_expander")
    set_pos(6,7,2, "grow")

    --Trees.
    local parent_depth = 0 --Will try to set now.
    local level = get_level() --Identical to "get_input_path_length".
    --Should make sure level-1 >= 0.
    -- local parent_bt = get_input_path_bt(level-1)
    -- if( parent_bt == "block_forest" ) then
        -- parent_depth = get_input_path_block_i(level-1, "depth")
    -- end
    if( get_input_path_block_var_exists(level-1, "depth", "i") ) then
        parent_depth = get_input_path_block_i(level-1, "depth")
    end
    --Setting the depth var of the block that is the current chunk.
    local depth = parent_depth + 1
    chunk_set_i("depth", depth)

    --Creating trees.
    --The greater the depth, the more trees there is.
    local num_trees = 2 * depth
    for i = 1,num_trees do
        local x = randi(0,15)
        local y = randi(0,15)
        set_pos(x,y,0, "r_green")
    end
end

function p.__type_init(id)
    ia_block_new_var_i(id, "depth", 0)
end
