Flowers: Add mushrooms to mgv6
authorparamat <mat.gregory@virginmedia.com>
Tue, 21 Jul 2015 23:16:40 +0000 (00:16 +0100)
committerparamat <mat.gregory@virginmedia.com>
Thu, 23 Jul 2015 04:14:32 +0000 (05:14 +0100)
mods/flowers/mapgen.lua

index aa0380a6ca9e4f5b91062c98a9b30c931301532e..9c03e2a14da4b9761df6a0c25a6a8901b4993521 100644 (file)
@@ -17,6 +17,25 @@ local function register_flower(name)
        })
 end
 
+local function register_mushroom(name)
+       minetest.register_decoration({
+               deco_type = "simple",
+               place_on = {"default:dirt_with_grass", "default:dirt"},
+               sidelen = 16,
+               noise_params = {
+                       offset = 0,
+                       scale = 0.006,
+                       spread = {x=100, y=100, z=100},
+                       seed = 7133,
+                       octaves = 3,
+                       persist = 0.6
+               },
+               y_min = -31000,
+               y_max = 30,
+               decoration = "flowers:"..name,
+       })
+end
+
 function flowers.register_mgv6_decorations()
        register_flower("rose")
        register_flower("tulip")
@@ -24,12 +43,14 @@ function flowers.register_mgv6_decorations()
        register_flower("geranium")
        register_flower("viola")
        register_flower("dandelion_white")
+
+       register_mushroom("mushroom_brown")
+       register_mushroom("mushroom_red")
 end
 
 -- Enable in mapgen v6 only
 
-local mg_params = minetest.get_mapgen_params()
-if mg_params.mgname == "v6" then
+if minetest.get_mapgen_params().mgname == "v6" then
        flowers.register_mgv6_decorations()
 end