-- STONES :
local function btmt_more_stones(stones_name,stones_desc,stones_tiles)
minetest.register_node(stones_name, {
	description = stones_desc,	
	tiles = {stones_tiles..".png"},
	groups = {cracky = 3},
	drop = stones_name,
	legacy_mineral = true,
	sounds = default.node_sound_stone_defaults()
})

stairs.register_stair_and_slab(stones_name,stones_name,
			{cracky = 3},
			{stones_tiles..".png"},
			stones_desc,
			stones_desc,
			default.node_sound_stone_defaults()
)

end

-- slates :
btmt_more_stones("btmt:slate_stone","Slate Stone","slate_stone")
btmt_more_stones("btmt:slate_stone_block","Slate Stone Block","slate_stone_block")
btmt_more_stones("btmt:slate_stone_brick","Slate Stone Brick","slate_stone_brick")

btmt_more_stones("btmt:strata_stone","Strata Stone","strata_stone")
btmt_more_stones("btmt:strata_stone_block","Strata Stone Block","strata_stone_block")
btmt_more_stones("btmt:strata_stone_brick","Strata Stone brick","strata_stone_brick")

btmt_more_stones("btmt:kyanite_stone","Kyanite Stone","kyanite_stone")
btmt_more_stones("btmt:kyanite_stone_block","Kyanite Stone Block","kyanite_stone_block")
btmt_more_stones("btmt:kyanite_stone_brick","Kyanite Stone Brick","kyanite_stone_brick")

--- CRAFTS sTONES :
local function craft_btmt_more_stones_block(stone_out,material_stone)
core.register_craft{
		--type = "shapeless",
		output = stone_out,
		recipe = {
		{material_stone,material_stone,material_stone},
		{material_stone,material_stone,material_stone},
		{material_stone,material_stone,material_stone},
		},
	}
end

local function craft_btmt_more_stones_brick(stone_out,material_stone)
core.register_craft{
		--type = "shapeless",
		output = stone_out,
		recipe = {
		{material_stone,material_stone,""},
		{material_stone,material_stone,""},
		{"","",""},
		},
	}
end

craft_btmt_more_stones_block("btmt:slate_stone_block","btmt:slate_stone")
craft_btmt_more_stones_block("btmt:strata_stone_block","btmt:strata_stone")
craft_btmt_more_stones_block("btmt:kyanite_stone_block","btmt:kyanite_stone")

craft_btmt_more_stones_brick("btmt:slate_stone_brick","btmt:slate_stone")
craft_btmt_more_stones_brick("btmt:strata_stone_brick","btmt:strata_stone")
craft_btmt_more_stones_brick("btmt:kyanite_stone_brick","btmt:kyanite_stone")
	
-- CAVES:
minetest.register_ore({
		ore_type       = "blob",
		ore            = "default:ice",
		wherein        = {"default:stone"} ,
		clust_scarcity = 1 * 1 * 1,
		clust_num_ores = 2,
		clust_size     = 2, 
		y_max          = -5,
		y_min          = -32,
		
		noise_params = {
		offset = 0,
		scale = 1,
		spread = {x = 100, y = 100, z = 100},
		seed = 24,
		octaves = 3,
		persistence = 0.8
	    },
	    
	    biomes = {"icesheet"},
		
})

minetest.register_ore({
		ore_type       = "blob",
		ore            = "default:mossycobble",
		wherein        = {"default:stone"} ,
		clust_scarcity = 1 * 1 * 1,
		clust_num_ores = 2,
		clust_size     = 2, 
		y_max          = -1,
		y_min          = -32,		
		noise_params = {
		offset = 0,
		scale = 1,
		spread = {x = 100, y = 100, z = 100},
		seed = 25,
		octaves = 3,
		persistence = 0.8
	    },
	    
	    biomes = {"rainforest"},
		
})
---- desert: 7860769037114009884
minetest.register_ore({
		ore_type       = "blob",
		ore            = "default:desert_sandstone",
		wherein        = {"default:desert_stone","default:desert_sandstone"} ,
		clust_scarcity = 1 * 1 * 1,
		clust_num_ores = 3,
		clust_size     = 2, 
		y_max          = 3,
		y_min          = -32,		
		noise_params = {
		offset = 0,
		scale = 1,
		spread = {x = 100, y = 100, z = 100},
		seed = 25,
		octaves = 3,
		persistence = 0.8
	    },
	    
	    biomes = {"desert"},
		
})

minetest.register_ore({
		ore_type       = "blob",
		ore            = "default:desert_sand",
		wherein        = {"default:desert_stone","default:desert_sandstone"} ,
		clust_scarcity = 1 * 1 * 1,
		clust_num_ores = 2,
		clust_size     = 1, 
		y_max          = 3,
		y_min          = -32,		
		noise_params = {
		offset = 0,
		scale = 1,
		spread = {x = 100, y = 100, z = 100},
		seed = 25,
		octaves = 3,
		persistence = 0.8
	    },
	    
	    biomes = {"desert"},
		
})

-- ADD NODES :
minetest.register_ore({
		ore_type       = "blob",
		ore            = "btmt:kyanite_stone",
		wherein        = {"default:stone"} ,
		clust_scarcity = 1 * 1 * 1,
		clust_num_ores = 3,
		clust_size     = 3, 
		y_max          = -8,
		y_min          = -14,
		
		noise_params = {
		offset = 0,
		scale = 1,
		spread = {x = 100, y = 100, z = 100},
		seed = 23,
		octaves = 3,
		persistence = 0.7
	    },
	    
	    biomes = {"icesheet"},		
})
---- STRATA :
minetest.register_ore({
		ore_type       = "blob",
		ore            = "btmt:strata_stone",
		wherein        = {"default:stone"},
		clust_scarcity = 1 * 1 * 1,
		clust_num_ores = 3,
		clust_size     = 3, 
		y_max          = 6,
		y_min          = 2,
		
		noise_params = {
		offset = 0,
		scale = 1,
		spread = {x = 100, y = 100, z = 100},
		seed = 26,
		octaves = 4,
		persistence = 0.7
	    },
	    
	    biomes = {"savanna"},		
})

minetest.register_ore({
		ore_type       = "blob",
		ore            = "btmt:strata_stone",
		wherein        = {"default:stone"},
		clust_scarcity = 1 * 1 * 1,
		clust_num_ores = 3,
		clust_size     = 3, 
		y_max          = 16,
		y_min          = 14,
		
		noise_params = {
		offset = 0,
		scale = 1,
		spread = {x = 100, y = 100, z = 100},
		seed = 26,
		octaves = 4,
		persistence = 0.7
	    },
	    
	    biomes = {"savanna"},		
})

-- Slate:
minetest.register_ore({
		ore_type       = "blob",
		ore            = "btmt:slate_stone",
		wherein        = {"default:stone","default:sand"} ,
		clust_scarcity = 4 * 4 * 4,
		clust_num_ores = 5,
		clust_size     = 5, -- 15
		y_max          = -30,
		y_min          = -3000,
		
			noise_params = { 
			offset  = 0, 
			scale   = 1,
			spread  = {x=100, y=100, z=100},
			seed    = 1034,
			octaves = 3, 
			persistence = 0.5,
			lacunarity = 2,
			flags = "defaults", 
		}		
})
