2015-08-07 17:03:53 +02:00
|
|
|
--
|
2015-07-29 03:19:49 +02:00
|
|
|
-- Mgv6
|
2015-08-07 17:03:53 +02:00
|
|
|
--
|
2015-07-29 03:19:49 +02:00
|
|
|
|
2018-03-18 01:25:16 +01:00
|
|
|
local function register_mgv6_flower(flower_name)
|
2015-03-24 21:48:59 +01:00
|
|
|
minetest.register_decoration({
|
2018-03-18 01:25:16 +01:00
|
|
|
name = "flowers:"..flower_name,
|
2015-03-24 21:48:59 +01:00
|
|
|
deco_type = "simple",
|
|
|
|
place_on = {"default:dirt_with_grass"},
|
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 0.006,
|
2015-09-16 03:38:58 +02:00
|
|
|
spread = {x = 100, y = 100, z = 100},
|
2015-03-24 21:48:59 +01:00
|
|
|
seed = 436,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.6
|
|
|
|
},
|
|
|
|
y_max = 30,
|
2018-02-25 12:25:34 +01:00
|
|
|
y_min = 1,
|
2018-03-18 01:25:16 +01:00
|
|
|
decoration = "flowers:"..flower_name,
|
2015-03-24 21:48:59 +01:00
|
|
|
})
|
|
|
|
end
|
2014-11-20 17:02:07 +01:00
|
|
|
|
2018-03-18 01:25:16 +01:00
|
|
|
local function register_mgv6_mushroom(mushroom_name)
|
2015-07-22 01:16:40 +02:00
|
|
|
minetest.register_decoration({
|
2018-03-18 01:25:16 +01:00
|
|
|
name = "flowers:"..mushroom_name,
|
2015-07-22 01:16:40 +02:00
|
|
|
deco_type = "simple",
|
2015-07-24 22:33:13 +02:00
|
|
|
place_on = {"default:dirt_with_grass"},
|
2015-07-22 01:16:40 +02:00
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = 0,
|
2015-08-07 17:03:53 +02:00
|
|
|
scale = 0.04,
|
2015-09-16 03:38:58 +02:00
|
|
|
spread = {x = 100, y = 100, z = 100},
|
2015-07-22 01:16:40 +02:00
|
|
|
seed = 7133,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.6
|
|
|
|
},
|
|
|
|
y_max = 30,
|
2018-02-25 12:25:34 +01:00
|
|
|
y_min = 1,
|
2018-03-18 01:25:16 +01:00
|
|
|
decoration = "flowers:"..mushroom_name,
|
2015-08-07 17:03:53 +02:00
|
|
|
spawn_by = "default:tree",
|
|
|
|
num_spawn_by = 1,
|
2015-07-22 01:16:40 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-09-16 03:38:58 +02:00
|
|
|
local function register_mgv6_waterlily()
|
|
|
|
minetest.register_decoration({
|
2018-03-18 01:25:16 +01:00
|
|
|
name = "flowers:waterlily",
|
2018-02-25 22:03:54 +01:00
|
|
|
deco_type = "simple",
|
2015-09-16 03:38:58 +02:00
|
|
|
place_on = {"default:dirt"},
|
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = -0.12,
|
|
|
|
scale = 0.3,
|
|
|
|
spread = {x = 100, y = 100, z = 100},
|
|
|
|
seed = 33,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.7
|
|
|
|
},
|
|
|
|
y_max = 0,
|
2018-02-25 12:25:34 +01:00
|
|
|
y_min = 0,
|
2019-06-16 23:09:36 +02:00
|
|
|
decoration = "flowers:waterlily_waving",
|
2018-02-25 22:03:54 +01:00
|
|
|
param2 = 0,
|
|
|
|
param2_max = 3,
|
|
|
|
place_offset_y = 1,
|
2015-09-16 03:38:58 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-03-24 21:48:59 +01:00
|
|
|
function flowers.register_mgv6_decorations()
|
2015-07-29 03:19:49 +02:00
|
|
|
register_mgv6_flower("rose")
|
|
|
|
register_mgv6_flower("tulip")
|
|
|
|
register_mgv6_flower("dandelion_yellow")
|
|
|
|
register_mgv6_flower("geranium")
|
|
|
|
register_mgv6_flower("viola")
|
|
|
|
register_mgv6_flower("dandelion_white")
|
|
|
|
|
2016-01-07 16:21:19 +01:00
|
|
|
register_mgv6_mushroom("mushroom_brown")
|
|
|
|
register_mgv6_mushroom("mushroom_red")
|
2015-09-16 03:38:58 +02:00
|
|
|
|
|
|
|
register_mgv6_waterlily()
|
2015-07-29 03:19:49 +02:00
|
|
|
end
|
|
|
|
|
2015-08-07 17:03:53 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
-- All other biome API mapgens
|
|
|
|
--
|
2015-07-29 03:19:49 +02:00
|
|
|
|
2018-03-18 01:25:16 +01:00
|
|
|
local function register_flower(seed, flower_name)
|
2015-07-29 03:19:49 +02:00
|
|
|
minetest.register_decoration({
|
2018-03-18 01:25:16 +01:00
|
|
|
name = "flowers:"..flower_name,
|
2015-07-29 03:19:49 +02:00
|
|
|
deco_type = "simple",
|
2017-12-24 03:23:29 +01:00
|
|
|
place_on = {"default:dirt_with_grass"},
|
2015-07-29 03:19:49 +02:00
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
2017-06-28 13:04:00 +02:00
|
|
|
offset = -0.02,
|
|
|
|
scale = 0.04,
|
2015-09-16 03:38:58 +02:00
|
|
|
spread = {x = 200, y = 200, z = 200},
|
2015-07-29 03:19:49 +02:00
|
|
|
seed = seed,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.6
|
|
|
|
},
|
2019-12-19 00:59:45 +01:00
|
|
|
biomes = {"grassland", "deciduous_forest"},
|
2015-07-29 03:19:49 +02:00
|
|
|
y_max = 31000,
|
2018-02-25 12:25:34 +01:00
|
|
|
y_min = 1,
|
2018-03-18 01:25:16 +01:00
|
|
|
decoration = "flowers:"..flower_name,
|
2015-07-29 03:19:49 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2018-03-18 01:25:16 +01:00
|
|
|
local function register_mushroom(mushroom_name)
|
2015-07-29 03:19:49 +02:00
|
|
|
minetest.register_decoration({
|
2018-03-18 01:25:16 +01:00
|
|
|
name = "flowers:"..mushroom_name,
|
2015-07-29 03:19:49 +02:00
|
|
|
deco_type = "simple",
|
2017-12-22 01:59:42 +01:00
|
|
|
place_on = {"default:dirt_with_grass", "default:dirt_with_coniferous_litter"},
|
2015-07-29 03:19:49 +02:00
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 0.006,
|
2016-12-01 04:15:15 +01:00
|
|
|
spread = {x = 250, y = 250, z = 250},
|
2015-08-07 17:03:53 +02:00
|
|
|
seed = 2,
|
2015-07-29 03:19:49 +02:00
|
|
|
octaves = 3,
|
2015-08-07 17:03:53 +02:00
|
|
|
persist = 0.66
|
2015-07-29 03:19:49 +02:00
|
|
|
},
|
2019-12-19 00:59:45 +01:00
|
|
|
biomes = {"deciduous_forest", "coniferous_forest"},
|
2015-07-29 03:19:49 +02:00
|
|
|
y_max = 31000,
|
2018-02-25 12:25:34 +01:00
|
|
|
y_min = 1,
|
2018-03-18 01:25:16 +01:00
|
|
|
decoration = "flowers:"..mushroom_name,
|
2015-07-29 03:19:49 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-09-16 03:38:58 +02:00
|
|
|
local function register_waterlily()
|
|
|
|
minetest.register_decoration({
|
2018-03-18 01:25:16 +01:00
|
|
|
name = "default:waterlily",
|
2018-02-25 22:03:54 +01:00
|
|
|
deco_type = "simple",
|
2015-09-28 04:14:44 +02:00
|
|
|
place_on = {"default:dirt"},
|
2015-09-16 03:38:58 +02:00
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = -0.12,
|
|
|
|
scale = 0.3,
|
|
|
|
spread = {x = 200, y = 200, z = 200},
|
|
|
|
seed = 33,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.7
|
|
|
|
},
|
2016-12-01 04:15:15 +01:00
|
|
|
biomes = {"rainforest_swamp", "savanna_shore", "deciduous_forest_shore"},
|
2015-09-16 03:38:58 +02:00
|
|
|
y_max = 0,
|
2018-02-25 12:25:34 +01:00
|
|
|
y_min = 0,
|
2019-06-16 23:09:36 +02:00
|
|
|
decoration = "flowers:waterlily_waving",
|
2018-02-25 22:03:54 +01:00
|
|
|
param2 = 0,
|
|
|
|
param2_max = 3,
|
|
|
|
place_offset_y = 1,
|
2015-09-16 03:38:58 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-07-29 03:19:49 +02:00
|
|
|
function flowers.register_decorations()
|
|
|
|
register_flower(436, "rose")
|
|
|
|
register_flower(19822, "tulip")
|
|
|
|
register_flower(1220999, "dandelion_yellow")
|
2017-11-20 05:13:41 +01:00
|
|
|
register_flower(800081, "chrysanthemum_green")
|
2015-07-29 03:19:49 +02:00
|
|
|
register_flower(36662, "geranium")
|
|
|
|
register_flower(1133, "viola")
|
|
|
|
register_flower(73133, "dandelion_white")
|
2017-11-20 05:13:41 +01:00
|
|
|
register_flower(42, "tulip_black")
|
2015-07-22 01:16:40 +02:00
|
|
|
|
2016-01-07 16:21:19 +01:00
|
|
|
register_mushroom("mushroom_brown")
|
|
|
|
register_mushroom("mushroom_red")
|
2015-09-16 03:38:58 +02:00
|
|
|
|
|
|
|
register_waterlily()
|
2014-11-05 21:22:55 +01:00
|
|
|
end
|
|
|
|
|
2015-08-07 17:03:53 +02:00
|
|
|
|
|
|
|
--
|
2015-07-29 03:19:49 +02:00
|
|
|
-- Detect mapgen to select functions
|
2015-08-07 17:03:53 +02:00
|
|
|
--
|
2014-11-05 21:22:55 +01:00
|
|
|
|
2016-07-06 18:14:39 +02:00
|
|
|
local mg_name = minetest.get_mapgen_setting("mg_name")
|
|
|
|
if mg_name == "v6" then
|
2015-03-24 21:48:59 +01:00
|
|
|
flowers.register_mgv6_decorations()
|
2016-12-01 04:15:15 +01:00
|
|
|
else
|
2015-07-29 03:19:49 +02:00
|
|
|
flowers.register_decorations()
|
2015-03-24 21:48:59 +01:00
|
|
|
end
|