function p.__get_is_solid() return true end
function p.__get_tex() return "block_default" end

function p.__main()
    set_default_block("s")
    
    --*******************************************
    --*******************************************
    --*******************************************

    --Creating the stick-and-ball data
    --structure for the caves (same as tut_lev4_caves1b).
    caves_start()
    caves_set_5x5x5()
    caves_set_num_nodes(2,3)
    caves_set_nodes(0.01, 3.0,4.3, 17.5,18.0)
    caves_set_edges(20.0, 0.0, 1.0,2.0, 7.0,8.0)
    caves_end()

    --*******************************************
    --*******************************************
    --*******************************************

    --A table, whose keys are the IDs of the nodes
    --that have a powerup placed in them.
    local filled_nodes = {}

    for x = 0,15 do
    for y = 0,15 do
    for z = 0,15 do
        local close_to_edge = caves_close_to_edge(x,y,z)

        local data = caves_close_to_node2(x,y,z)
        local close_to_node = data.close
        
        --Carving the position if need be.
        if close_to_node or close_to_edge then
            set_pos(x,y,z,"e")
        end

        --Adding gold in the center (for each node).
        if close_to_node then
            local which_node = data.which_node
            local dist = data.dist
            local is_big = data.is_big

            if (dist < 1.5) and
                filled_nodes[which_node] == nil
            then
                filled_nodes[which_node] = true
                add_bent(x,y,z, "bent_diamond")
            end
        end

    end end end
end
