From 75e0a665ce2a45e1158a427d3f70f854f5f4d5a8 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 16 Jun 2017 18:12:21 -0400 Subject: 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 --- farming/mapgen.lua | 88 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 39 deletions(-) (limited to 'farming/mapgen.lua') 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 -- cgit v1.2.3