From a7bebc671920fd58992de4ff5a5f2716c891565c Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 19 Feb 2017 12:01:09 -0500 Subject: updated bobblocks, gloopblocks, maptools, mesecons, moreblocks, moreores, plantlife, and xban2, and switched to TenPlus1's "farming redo" mod in lieu of Pilzadam's farming_plus since the latter breaks default farming. --- farming/mapgen.lua | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 farming/mapgen.lua (limited to 'farming/mapgen.lua') diff --git a/farming/mapgen.lua b/farming/mapgen.lua new file mode 100644 index 0000000..36d4792 --- /dev/null +++ b/farming/mapgen.lua @@ -0,0 +1,65 @@ +-- decoration function +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, + spread = {x = 100, y = 100, z = 100}, + seed = 329, + octaves = 3, + persist = 0.6 + }, + y_min = min, + y_max = max, + decoration = "farming:" .. name, + spawn_by = spawnby, + num_spawn_by = num, + }) +end + +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) + register_plant("rhubarb_3", 3, 15, "", -1) + register_plant("blueberry_4", 3, 10, "", -1) + register_plant("beanbush", 18, 35, "", -1) + register_plant("grapebush", 25, 45, "", -1) +end + +-- v7 maps have a beach so plants growing near water is limited to 6 high +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) + register_plant("rhubarb_3", 3, 15, "", -1) + register_plant("blueberry_4", 3, 10, "", -1) + register_plant("beanbush", 18, 35, "", -1) + register_plant("grapebush", 25, 45, "", -1) +end + +-- detect mapgen +local mg_name = minetest.get_mapgen_params().mgname + +if mg_name == "v6" then + farming.register_mgv6_decorations() +else + farming.register_mgv7_decorations() +end -- cgit v1.2.3