57 lines
1.2 KiB
Lua
57 lines
1.2 KiB
Lua
-- decoration function
|
|
local function register_mgv6_flower(name)
|
|
minetest.register_decoration({
|
|
deco_type = "simple",
|
|
place_on = {"default:dirt_with_grass"},
|
|
sidelen = 16,
|
|
noise_params = {
|
|
offset = 0,
|
|
scale = 0.006,
|
|
spread = {x = 100, y = 100, z = 100},
|
|
seed = 368,
|
|
octaves = 3,
|
|
persist = 0.6
|
|
},
|
|
y_min = 1,
|
|
y_max = 30,
|
|
decoration = "moreflowers:"..name,
|
|
})
|
|
end
|
|
|
|
local function register_flower(seed, name)
|
|
minetest.register_decoration({
|
|
deco_type = "simple",
|
|
place_on = {"default:dirt_with_grass"},
|
|
sidelen = 16,
|
|
noise_params = {
|
|
offset = -0.015,
|
|
scale = 0.025,
|
|
spread = {x = 200, y = 200, z = 200},
|
|
seed = seed,
|
|
octaves = 3,
|
|
persist = 0.6
|
|
},
|
|
biomes = {"grassland", "deciduous_forest", "coniferous_forest"},
|
|
y_min = 1,
|
|
y_max = 31000,
|
|
decoration = "moreflowers:" .. name,
|
|
})
|
|
end
|
|
|
|
function moreflowers.register_mgv6_decorations()
|
|
register_mgv6_flower("wild_carrot")
|
|
end
|
|
|
|
function moreflowers.register_decorations()
|
|
register_flower(368, "wild_carrot")
|
|
end
|
|
|
|
-- detect mapgen
|
|
local mg_name = minetest.get_mapgen_setting("mg_name")
|
|
|
|
if mg_name == "v6" then
|
|
moreflowers.register_mgv6_decorations()
|
|
else
|
|
moreflowers.register_decorations()
|
|
end
|