summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2015-07-31 16:28:32 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2015-07-31 16:28:32 +0100
commit5757896caaeac6f47732344f9d870fe65d9df8ce (patch)
tree72d24b242720f798e076400c7e1f80cdca58b90c
parent3d12807ca86ea8e62ef319431fbd30a01a1cdf41 (diff)
Crops appear on v7/v5 maps as well
-rw-r--r--mapgen.lua26
1 files changed, 21 insertions, 5 deletions
diff --git a/mapgen.lua b/mapgen.lua
index b93c2d0..f799222 100644
--- a/mapgen.lua
+++ b/mapgen.lua
@@ -1,6 +1,4 @@
-
--- spawn new foods on map
-
+-- decoration function
local function register_plant(name, min, max, spawnby, num)
minetest.register_decoration({
deco_type = "simple",
@@ -16,7 +14,7 @@ local function register_plant(name, min, max, spawnby, num)
},
y_min = min,
y_max = max,
- decoration = "farming:"..name,
+ decoration = "farming:" .. name,
spawn_by = spawnby,
num_spawn_by = num,
})
@@ -38,8 +36,26 @@ function farming.register_mgv6_decorations()
register_plant("beanbush", 18, 35, "", -1)
end
--- enable in v6 mapgen only
+-- 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, "group:tree", 1)
+ register_plant("blueberry_4", 3, 10, "", -1)
+ register_plant("beanbush", 18, 35, "", -1)
+end
+-- detect mapgen
if minetest.get_mapgen_params().mgname == "v6" then
farming.register_mgv6_decorations()
+else
+ farming.register_mgv7_decorations()
end \ No newline at end of file