
local sealevel = aom_vars.overworld.sea_level
local alt_max = aom_vars.overworld.alt_max
local alt_min = aom_vars.overworld.alt_min

local sch = aom_sch.get_schematic_path

-- minetest.register_decoration({
--     name = "aom_flora:warpberry_4_1",
--     deco_type = "simple",
--     place_on = {"group:topsoil"},
--     sidelen = 16,
--     noise_params = {
--         offset = -0.04,
--         scale = 0.1,
--         spread = {x = 20, y = 20, z = 20},
--         seed = 6456,
--         octaves = 3,
--         persist = 0.2
--     },
--     biomes = {
--         -- "oak_forest_dense",
--         -- "oak_forest_dense_1",
--     },
--     y_max = alt_max,
--     y_min = sealevel - 10,
--     decoration = "aom_flora:warpberry_stem",
--     -- flags = "all_floors"
-- })

local np = {
    offset = -0.08,
    scale = 0.1,
    spread = {x = 10, y = 10, z = 10},
    seed = 6456,
    octaves = 3,
    persist = 0.2
}
local biomes = {
}

minetest.register_decoration({
    deco_type = "schematic",
    place_on = {"group:topsoil"},
    sidelen = 8,
    noise_params = np,
    biomes = biomes,
    y_max = alt_max,
    y_min = sealevel + 60,
    schematic = sch("warpberry_bush"),
    flags = "place_center_x, place_center_z",
    rotation = "random",
    place_offset_y = 1,
})
minetest.register_decoration({
    deco_type = "schematic",
    place_on = {"group:topsoil"},
    sidelen = 8,
    noise_params = np,
    biomes = biomes,
    y_max = alt_max,
    y_min = sealevel + 60,
    schematic = sch("warpberry_bush_fruit"),
    flags = "place_center_x, place_center_z",
    rotation = "random",
    place_offset_y = 1,
})
