From 2a154838f9b1fb1b708d2e07130b24ed4716d1c2 Mon Sep 17 00:00:00 2001 From: kabou Date: Wed, 4 May 2022 14:55:19 +0200 Subject: [PATCH] Also generate double grass when bonemealing grass blocks. --- mods/ITEMS/mcl_flowers/bonemealing.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_flowers/bonemealing.lua b/mods/ITEMS/mcl_flowers/bonemealing.lua index 297c297e8..26fc8a44c 100644 --- a/mods/ITEMS/mcl_flowers/bonemealing.lua +++ b/mods/ITEMS/mcl_flowers/bonemealing.lua @@ -71,8 +71,18 @@ local biome_flowers_tables = { -- local function add_random_flower(pos, color) -- 90% tall grass, 10% flower - if math.random(1,100) <= 90 then + local rnd = math.random(1,100) + if rnd <= 60 then minetest.add_node(pos, {name="mcl_flowers:tallgrass", param2=color}) + elseif rnd <= 80 then + -- double tallgrass + local toppos = vector.offset(pos, 0, 1, 0) + local topnode = minetest.get_node(toppos) + if minetest.registered_nodes[topnode.name].buildable_to then + minetest.set_node(pos, { name = "mcl_flowers:double_grass", param2 = color }) + minetest.set_node(toppos, { name = "mcl_flowers:double_grass_top", param2 = color }) + return true + end else local flowers_table if mg_name == "v6" then