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

-- SOIL
if not dp.soil then
    dp.soil = m7a.register_node("natural_habitat:soil", {
        description = S("Soil"),
        tiles = { "nbt_soil.png" },
        groups = m7a.mod_impact(
            { crumbly=3, soil=1 }, {
                ["mcl_player"] = {
                    handy=1, shovely=1, dirt=1, soil=1, 
                    soil_flower=1, soil_generic_plant=1, 
                    soil_sapling=2, soil_sugarcane=1, 
                    soil_bamboo=1, soil_fungus=1, cultivatable=2, 
                    enderman_takable=1, building_block=1, 
                    converts_to_moss=1, converts_to_mud=1,
                },
            }
        ),
        sounds = natural_habitat.sound_soil(),
        
        _doc_items_longdesc = S(
            "Soil for a few plants. When in light, "..
            "this block may grow a grass or mycelium cover if such blocks are nearby."
        ),
        _doc_items_hidden = false,
    
        --_on_shovel_place = mcl_core.make_dirtpath,
        --_on_bottle_place = mcl_core.bottle_dirt,
        _mcl_hardness = 0.5,
        _tnt_loss = 3,
    });
    
    core.register_alias("dirt", dp.soil);
end;

-- SOIL WITH GRASS
if not dp.soil_with_grass then
    dp.soil_with_grass = m7a.register_node("natural_habitat:soil_with_grass", {
        description = S("Soil with Grass"),
        tiles = { "nbt_grass.png", "nbt_soil.png", "nbt_soil.png^nbt_grass_side.png" },
        groups = m7a.mod_impact(
            { crumbly=3, soil=1, spreading_dirt_type=1 }, {
                ["mcl_player"] = {
                    handy=1, shovely=1, dirt=2, grass_block=1, grass_block_no_snow=1,
                    soil=1, soil_sapling=2, soil_flower=1, soil_generic_plant=1, 
                    soil_sugarcane=1, soil_bamboo=1, soil_fungus=1, cultivatable=2,
                    spreading_dirt_type=1, enderman_takable=1, building_block=1,
                    compostability=30, biomecolor=1, converts_to_moss=1,
                },
            }
        ),
        sounds = natural_habitat.sound_soil({
            footstep = {name = "default_grass_footstep", gain = 0.25},
        }),
        drop = dp.soil,
        
        _doc_items_longdesc = S(
            "Soil for a few plants. When in light, "..
            "this block may grow a grass or mycelium cover if such blocks are nearby."
        ),
        _doc_items_hidden = false,
    
        --_on_shovel_place = mcl_core.make_dirtpath,
        --_on_bottle_place = mcl_core.bottle_dirt,
        --_mcl_snowed = "mcl_core:dirt_with_grass_snow",
        _mcl_silk_touch_drop = true,
        --_on_bone_meal = mcl_core.bone_meal_grass,
        _mcl_hardness = 0.6,
        _tnt_loss = 3,
    });
    
    core.register_alias("dirt_with_grass", dp.soil_with_grass);
end;