1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2024-12-27 03:00:20 +01:00

Crops appear on v7/v5 maps as well

This commit is contained in:
TenPlus1 2015-07-31 16:28:32 +01:00
parent 3d12807ca8
commit 5757896caa

View File

@ -1,6 +1,4 @@
-- decoration function
-- spawn new foods on map
local function register_plant(name, min, max, spawnby, num) local function register_plant(name, min, max, spawnby, num)
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
@ -16,7 +14,7 @@ local function register_plant(name, min, max, spawnby, num)
}, },
y_min = min, y_min = min,
y_max = max, y_max = max,
decoration = "farming:"..name, decoration = "farming:" .. name,
spawn_by = spawnby, spawn_by = spawnby,
num_spawn_by = num, num_spawn_by = num,
}) })
@ -38,8 +36,26 @@ function farming.register_mgv6_decorations()
register_plant("beanbush", 18, 35, "", -1) register_plant("beanbush", 18, 35, "", -1)
end 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 if minetest.get_mapgen_params().mgname == "v6" then
farming.register_mgv6_decorations() farming.register_mgv6_decorations()
else
farming.register_mgv7_decorations()
end end