From 05e37defcb4c04cb3a7c6753ac7e8d29aa47f8dd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 14 Mar 2017 19:35:37 +0100 Subject: [PATCH] Make bone meal increase size of tall grass + fern --- mods/ITEMS/mcl_dye/init.lua | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 7c12d59e08..575c134f4a 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -214,9 +214,27 @@ mcl_dye.apply_bone_meal = function(pointed_thing) end end return true - else - return false + elseif n.name == "mcl_core:tallgrass" then + -- Grow tall grass into double tallgrass + local toppos = { x=pos.x, y=pos.y+1, z=pos.z } + local topnode = minetest.get_node(toppos) + if minetest.registered_nodes[topnode.name].buildable_to then + minetest.set_node(pos, { name = "mcl_flowers:double_grass" }) + minetest.set_node(toppos, { name = "mcl_flowers:double_grass_top" }) + return true + end + elseif n.name == "mcl_flowers:fern" then + -- Grow fern into large fern + local toppos = { x=pos.x, y=pos.y+1, z=pos.z } + local topnode = minetest.get_node(toppos) + if minetest.registered_nodes[topnode.name].buildable_to then + minetest.set_node(pos, { name = "mcl_flowers:double_fern" }) + minetest.set_node(toppos, { name = "mcl_flowers:double_fern_top" }) + return true + end end + + return false end minetest.register_craftitem("mcl_dye:white", {