1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-13 22:10:31 +01:00
server-nalc/minetestforfun_game/mods/farming/mapgen.lua
LeMagnesium 9eaff838e5 Updated MinetestForFun Game
- Moved farming and screwdriver into MinetestForFun Game
 - Updated files (mostly `is_ground_content`)
 - Removed weird partial copy of jukebox in MinetestForFun Game
2015-06-18 13:22:23 +02:00

47 lines
1.2 KiB
Lua
Executable File

-- spawn new foods on map
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, "group:tree", 1)
register_plant("blueberry_4", 3, 10, "", -1)
register_plant("beanbush", 18, 35, "", -1)
end
-- enable in mapgen v6 only
local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v6" then
farming.register_mgv6_decorations()
end