summaryrefslogtreecommitdiff
path: root/farming/mapgen.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-06-16 18:12:21 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-06-16 18:12:21 -0400
commit75e0a665ce2a45e1158a427d3f70f854f5f4d5a8 (patch)
tree881209e2c8f7efcbce69482bc3caa19b4828e290 /farming/mapgen.lua
parentb8cd2f723c7c9079e631d7a4078862ff47b24915 (diff)
downloaddreambuilder_modpack-75e0a665ce2a45e1158a427d3f70f854f5f4d5a8.tar
dreambuilder_modpack-75e0a665ce2a45e1158a427d3f70f854f5f4d5a8.tar.gz
dreambuilder_modpack-75e0a665ce2a45e1158a427d3f70f854f5f4d5a8.tar.bz2
dreambuilder_modpack-75e0a665ce2a45e1158a427d3f70f854f5f4d5a8.tar.xz
dreambuilder_modpack-75e0a665ce2a45e1158a427d3f70f854f5f4d5a8.zip
Updated several mods for Minetest 0.4.16
castles modpack, areas, biome_lib, blox, boost_cart, plantlife modpack caverealms, coloredwood, concrete, currency, farming redo, home decor, ilights, mesecons, moreores, pipeworks, signs_lib, technic, unified inventory unified bricks, unified dyes, worldedit, and xban2
Diffstat (limited to 'farming/mapgen.lua')
-rw-r--r--farming/mapgen.lua88
1 files changed, 49 insertions, 39 deletions
diff --git a/farming/mapgen.lua b/farming/mapgen.lua
index 36d4792..090c193 100644
--- a/farming/mapgen.lua
+++ b/farming/mapgen.lua
@@ -1,5 +1,11 @@
+
-- decoration function
-local function register_plant(name, min, max, spawnby, num)
+local function register_plant(name, min, max, spawnby, num, enabled)
+
+ if enabled ~= true then
+ return
+ end
+
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
@@ -20,46 +26,50 @@ local function register_plant(name, min, max, spawnby, 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
+-- add crops to mapgen
+register_plant("potato_3", 15, 40, "", -1, farming.potato)
+register_plant("tomato_7", 5, 20, "", -1, farming.tomato)
+register_plant("corn_7", 12, 22, "", -1, farming.corn)
+register_plant("coffee_5", 20, 45, "", -1, farming.coffee)
+register_plant("raspberry_4", 3, 10, "", -1, farming.raspberry)
+register_plant("rhubarb_3", 3, 15, "", -1, farming.rhubarb)
+register_plant("blueberry_4", 3, 10, "", -1, farming.blueberry)
+register_plant("beanbush", 18, 35, "", -1, farming.beans)
+register_plant("grapebush", 25, 45, "", -1, farming.grapes)
+
--- detect mapgen
-local mg_name = minetest.get_mapgen_params().mgname
+if minetest.get_mapgen_params().mgname == "v6" then
-if mg_name == "v6" then
- farming.register_mgv6_decorations()
+ register_plant("carrot_8", 1, 30, "group:water", 1, farming.carrot)
+ register_plant("cucumber_4", 1, 20, "group:water", 1, farming.cucumber)
+ register_plant("melon_8", 1, 20, "group:water", 1, farming.melon)
+ register_plant("pumpkin_8", 1, 20, "group:water", 1, farming.pumpkin)
else
- farming.register_mgv7_decorations()
+ -- v7 maps have a beach so plants growing near water is limited to 6 high
+ register_plant("carrot_8", 1, 6, "", -1, farming.carrot)
+ register_plant("cucumber_4", 1, 6, "", -1, farming.cucumber)
+ register_plant("melon_8", 1, 6, "", -1, farming.melon)
+ register_plant("pumpkin_8", 1, 6, "", -1, farming.pumpkin)
+end
+
+if farming.hemp then
+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,
+})
end