local S = core.get_translator(core.get_current_modname());
local modpath = core.get_modpath(core.get_current_modname());
local schempath = modpath.."/schems/data";
local dp = natural_habitat.dupes;

-- HIBISCUS SABDARIFFA
natural_habitat.register_bush("hibsab", {
    name = S("Hibiscus Sabdariffa"),
    mts_color = "#96b06b",
    mcl_color = "#589C44",
    
    stages = {
        leaves = {
            description = S("Leaves"),
            mesh = "nbt_bush.obj",
            textures = { "nbt_hibsab_leaves.png" },
        },
        blossom = {
            description = S("Blossom"),
            mesh = "nbt_bush_flower.obj",
            textures = { "nbt_hibsab_leaves.png", "nbt_hibsab_blossom.png" },
        },
    },
});

-- REGISTER DECORATION
m7a.register_multideco("natural_habitat:deco_hibsab", {
    sidelen = 3,
    noise_params = {
        offset = 0,
        scale = 0.001,
        spread = {x = 250, y = 250, z = 250},
        seed = 865846556,
        octaves = 3,
        persist = 0.001,
        flags = "absvalue",
    },
    spawn_by = { "air" },
    num_spawn_by = 5,
    y_max = 100,
    y_min = 1,
    flags = "place_center_x, place_center_z",
    place_on = {
        dp.soil_with_grass, "default:dirt_with_dry_grass",
        "default:dry_dirt_with_dry_grass",
    },
    biomes = {
        dp.biomes.grassland, dp.biomes.meadow, dp.biomes.savanna,
    },
    decos = {
        { deco_type= "simple", sidelen=1, decoration="natural_habitat:hibsab_blossom", },
        
        { deco_type="schematic", schematic=schempath.."/nbt_hibsab_bush_1.mts", },
        { deco_type="schematic", schematic=schempath.."/nbt_hibsab_bush_2.mts", },
        { deco_type="schematic", schematic=schempath.."/nbt_hibsab_bush_3.mts", },
    },
    force_placement = false,
    rotation = "random",
});