local S = core.get_translator(core.get_current_modname());
local dp = natural_habitat.dupes;

if not dp.globe_thistle then
    dp.globe_thistle = "natural_habitat:globe_thistle";
    
    core.register_node(dp.globe_thistle, {
        description = S("Globe Thistle"),
        inventory_umage = "nbt_flower_globe_thistle_inv.png",
        drawtype = "mesh",
        mesh = "nbt_flower_bubble.obj",
        tiles = { "nbt_flower_globe_thistle.png", },
        use_texture_alpha = "clip",
        paramtype = "light",
        paramtype2 = "facedir",
        selection_box = {type = "fixed", fixed = {{-0.25, -0.5, -0.2, 0.35, 0.75, 0.2}}},
        groups = m7a.impact(
            { snappy=3, flower=1, flora=1, attached_node=1 },
            {
                ["mineclonia"] = {
                    attached_node=1, deco_block=1, dig_by_piston=1, dig_immediate=3,
                    dig_by_water=1, destroy_by_lava_flow=1, enderman_takable=1,
                    plant=1, flower=1, place_flowerlike=1, non_mycelium_plant=1,
                    flammable=2, fire_encouragement=60, fire_flammability=100,
                    compostability=65, unsticky=1,
                },
            }
        ),
        place_on = { dp.soil, dp.soil_with_grass, dp.podzol },
        walkable = false,
        sounds = natural_habitat.sound_leaves(),
        sunlight_propagates = true,
        on_place = function(itemstack, placer, pointed_thing)
            return m7a.place_item(itemstack, placer, pointed_thing).itemstack;
        end,
        rotation = "random",
    });
    
    core.register_decoration({
        deco_type = "simple",
        decoration = dp.globe_thistle,
        place_on = { dp.soil, dp.soil_with_grass, dp.podzol },
        fill_ratio = 0.002,
        biomes = { dp.biomes.mountains, dp.biomes.meadow, dp.biomes.grassland },
        spawn_by = "air",
        num_spawn_by = 1,
        y_min = 5,
        y_max = 31000,
    });
end;