local rock1 = { type = "fixed", fixed = {{-0.1875, -0.5, -0.1875, 0.1875, -0.3125, 0.1875},}}
local rock2 = { type = "fixed", fixed = {{-0.1875, -0.5, -0.1875, 0.1875, -0.3125, 0.1875},}}
local rock3 = { type = "fixed", fixed = {{-0.1875, -0.5, -0.1875, 0.1875, -0.3125, 0.1875},}}
local rock4 = { type = "fixed", fixed = {{-0.1875, -0.5, -0.1875, 0.1875, -0.3125, 0.1875},}}
local rock5 = { type = "fixed", fixed = {{-0.3125, -0.5, -0.3125, 0.3125, -0.2, 0.3155},}}



local rocks = {{"rock", "Rock 1", rock1},
				{"rock2", "Rock 2", rock2},
				{"rock3", "Rock 3", rock3},
				{"rock4", "Rock 4", rock4},
				{"rock5", "Rock 5", rock5},}
				
for i in ipairs(rocks) do
	local nam = rocks[i][1]
	local des = rocks[i][2]
	local box = rocks[i][3]

core.register_node("myrocks:"..nam, {
	description = des,
	tiles = {"default_stone.png"},
	drawtype = "mesh",
	mesh = "myrocks_"..nam..".obj",
	paramtype = "light",
	paramtype2 = "facedir",
	pointable = true,
	is_ground_content = true,
	groups = {dig_immediate=3,cracky = 2,not_in_creative_inventory=1, falling_node = 1, stone = 1, rock = 1},
	selection_box = box,
	collision_box = box
})
	local mod = core.get_modpath("mymagic_tools")
	
	if mod then
		core.register_craft({
			output = "mymagic_tools:knife_stone",
			recipe ={
					{"","group:rock",""},
					{"","group:rock",""},
					{"","default:stick",""},
					}
		})
	else
		core.register_craft({
			output = "default:sword_stone",
			recipe ={
					{"","group:rock",""},
					{"","group:rock",""},
					{"","default:stick",""},
					}
		})
	end

		core.register_craft({
			output = "default:pick_stone",
			recipe ={
					{"group:rock","group:rock","group:rock"},
					{"","default:stick",""},
					{"","default:stick",""},
					}
		})

		core.register_craft({
			output = "default:shovel_stone",
			recipe ={
					{"","group:rock",""},
					{"","default:stick",""},
					{"","default:stick",""},
					}
		})
		core.register_craft({
			output = "default:axe_stone",
			recipe ={
					{"group:rock","group:rock",""},
					{"group:rock","default:stick",""},
					{"","default:stick",""},
					}
		})
		core.register_craft({
			output = "farming:hoe_stone",
			recipe ={
					{"group:rock","group:rock",""},
					{"","default:stick",""},
					{"","default:stick",""},
					}
		})

	if core.get_modpath("lucky_block") then
		lucky_block:add_blocks({
			{"dro", {"myrocks:"..nam}, 12},
		})
	end


end
----------------------------------------------------------
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_grass"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_dry_grass"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_snow"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_stone"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:silver_sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
------------------------------------------------


core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_grass"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock2",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_dry_grass"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_snow"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock2",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_stone"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock2",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock2",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock2",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:silver_sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock2",
})
-----------------------------------------------------
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_grass"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock3",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_dry_grass"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock3",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_snow"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock3",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_stone"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock3",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock3",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock3",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:silver_sand"},
    sidelen = 16,
    fill_ratio = 0.0015,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock3",
})
-----------------------------------------------------
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_grass"},
    sidelen = 16,
    fill_ratio = 0.001,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock4",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_dry_grass"},
    sidelen = 16,
    fill_ratio = 0.001,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock4",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_snow"},
    sidelen = 16,
    fill_ratio = 0.001,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock4",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_stone"},
    sidelen = 16,
    fill_ratio = 0.001,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock4",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:sand"},
    sidelen = 16,
    fill_ratio = 0.001,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock4",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_sand"},
    sidelen = 16,
    fill_ratio = 0.001,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock4",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:silver_sand"},
    sidelen = 16,
    fill_ratio = 0.001,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock4",
})
-----------------------------------------------------
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_grass"},
    sidelen = 16,
    fill_ratio = 0.0002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock5",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_dry_grass"},
    sidelen = 16,
    fill_ratio = 0.0002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock5",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_snow"},
    sidelen = 16,
    fill_ratio = 0.0002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock5",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_stone"},
    sidelen = 16,
    fill_ratio = 0.0002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock5",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:sand"},
    sidelen = 16,
    fill_ratio = 0.0002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock5",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_sand"},
    sidelen = 16,
    fill_ratio = 0.0002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock5",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:silver_sand"},
    sidelen = 16,
    fill_ratio = 0.0002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:rock5",
})

------------------------------------------------------------

core.register_node("myrocks:stick", {
	description = "Stick",
	tiles = {"default_sandstone.png"},
	drawtype = "mesh",
	mesh = "myrocks_stick.obj",
	paramtype = "light",
	paramtype2 = "facedir",
	pointable = true,
	is_ground_content = true,
	groups = {dig_immediate=3,cracky = 2,not_in_creative_inventory=0, falling_node = 1, stick = 1},
	selection_box = {
		type = "fixed",
		fixed = {-0.4, -0.5, -0.2, 0.4, -0.4, 0.2}},
	collision_box = {
		type = "fixed",
		fixed = {-0.4, -0.5, -0.2, 0.4, -0.4, 0.2}},
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_grass"},
    sidelen = 16,
    fill_ratio = 0.002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:stick",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_dry_grass"},
    sidelen = 16,
    fill_ratio = 0.002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:stick",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:dirt_with_snow"},
    sidelen = 16,
    fill_ratio = 0.002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:stick",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_stone"},
    sidelen = 16,
    fill_ratio = 0.002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:stick",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:sand"},
    sidelen = 16,
    fill_ratio = 0.002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:stick",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:desert_sand"},
    sidelen = 16,
    fill_ratio = 0.002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:stick",
})
core.register_decoration({
    deco_type = "simple",
    place_on = {"default:silver_sand"},
    sidelen = 16,
    fill_ratio = 0.002,
    biomes = {"grassy_plains"},
    y_max = 50,
    y_min = 1,
    decoration = "myrocks:stick",
})
