2015-07-31 17:28:32 +02:00
|
|
|
-- decoration function
|
2015-04-11 10:42:39 +02:00
|
|
|
local function register_plant(name, min, max, spawnby, num)
|
|
|
|
minetest.register_decoration({
|
|
|
|
deco_type = "simple",
|
|
|
|
place_on = {"default:dirt_with_grass"},
|
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 0.006,
|
2015-07-05 11:54:18 +02:00
|
|
|
spread = {x = 100, y = 100, z = 100},
|
2015-04-11 10:42:39 +02:00
|
|
|
seed = 329,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.6
|
|
|
|
},
|
|
|
|
y_min = min,
|
|
|
|
y_max = max,
|
2015-07-31 17:28:32 +02:00
|
|
|
decoration = "farming:" .. name,
|
2015-04-11 10:42:39 +02:00
|
|
|
spawn_by = spawnby,
|
|
|
|
num_spawn_by = num,
|
|
|
|
})
|
|
|
|
end
|
2015-03-20 15:00:56 +01:00
|
|
|
|
2015-04-11 10:42:39 +02:00
|
|
|
function farming.register_mgv6_decorations()
|
|
|
|
register_plant("potato_3", 15, 40, "", -1)
|
|
|
|
register_plant("tomato_7", 5, 20, "", -1)
|
|
|
|
register_plant("carrot_8", 1, 30, "group:water", 1)
|
|
|
|
register_plant("cucumber_4", 1, 20, "group:water", 1)
|
|
|
|
register_plant("corn_7", 12, 22, "", -1)
|
|
|
|
register_plant("corn_8", 10, 20, "", -1)
|
|
|
|
register_plant("coffee_5", 20, 45, "", -1)
|
|
|
|
register_plant("melon_8", 1, 20, "group:water", 1)
|
|
|
|
register_plant("pumpkin_8", 1, 20, "group:water", 1)
|
|
|
|
register_plant("raspberry_4", 3, 10, "", -1)
|
2015-12-08 15:47:22 +01:00
|
|
|
register_plant("rhubarb_3", 3, 15, "", -1)
|
2015-04-11 10:42:39 +02:00
|
|
|
register_plant("blueberry_4", 3, 10, "", -1)
|
2015-04-19 13:42:12 +02:00
|
|
|
register_plant("beanbush", 18, 35, "", -1)
|
2015-10-26 12:22:40 +01:00
|
|
|
register_plant("grapebush", 25, 45, "", -1)
|
2015-03-20 15:00:56 +01:00
|
|
|
end
|
|
|
|
|
2015-12-08 15:47:22 +01:00
|
|
|
-- v7 maps have a beach so plants growing near water is limited to 6 high
|
2015-07-31 17:28:32 +02:00
|
|
|
function farming.register_mgv7_decorations()
|
|
|
|
register_plant("potato_3", 15, 40, "", -1)
|
|
|
|
register_plant("tomato_7", 5, 20, "", -1)
|
|
|
|
register_plant("carrot_8", 1, 6, "", -1)
|
|
|
|
register_plant("cucumber_4", 1, 6, "", -1)
|
|
|
|
register_plant("corn_7", 12, 22, "", -1)
|
|
|
|
register_plant("corn_8", 10, 20, "", -1)
|
|
|
|
register_plant("coffee_5", 20, 45, "", -1)
|
|
|
|
register_plant("melon_8", 1, 6, "", -1)
|
|
|
|
register_plant("pumpkin_8", 1, 6, "", -1)
|
|
|
|
register_plant("raspberry_4", 3, 10, "", -1)
|
2015-12-08 15:47:22 +01:00
|
|
|
register_plant("rhubarb_3", 3, 15, "", -1)
|
2015-07-31 17:28:32 +02:00
|
|
|
register_plant("blueberry_4", 3, 10, "", -1)
|
|
|
|
register_plant("beanbush", 18, 35, "", -1)
|
2015-10-26 12:22:40 +01:00
|
|
|
register_plant("grapebush", 25, 45, "", -1)
|
2015-07-31 17:28:32 +02:00
|
|
|
end
|
2015-03-20 15:00:56 +01:00
|
|
|
|
2017-04-08 12:00:12 +02:00
|
|
|
minetest.register_decoration({
|
|
|
|
deco_type = "simple",
|
|
|
|
place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"},
|
|
|
|
sidelen = 16,
|
|
|
|
noise_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 0.06,
|
|
|
|
spread = {x = 100, y = 100, z = 100},
|
|
|
|
seed = 420,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.6
|
|
|
|
},
|
|
|
|
y_min = 5,
|
|
|
|
y_max = 35,
|
|
|
|
decoration = "farming:hemp_7",
|
|
|
|
spawn_by = "group:tree",
|
|
|
|
num_spawn_by = 1,
|
|
|
|
})
|
|
|
|
|
2015-07-31 17:28:32 +02:00
|
|
|
-- detect mapgen
|
2016-10-07 10:35:08 +02:00
|
|
|
local mg_name = minetest.get_mapgen_params().mgname
|
|
|
|
|
|
|
|
if mg_name == "v6" then
|
|
|
|
farming.register_mgv6_decorations()
|
2015-07-31 17:28:32 +02:00
|
|
|
else
|
2016-10-07 10:35:08 +02:00
|
|
|
farming.register_mgv7_decorations()
|
2016-08-14 10:27:38 +02:00
|
|
|
end
|