From 12a02f99615e9ddca71a6b3f504b7c8591134691 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 9 Jun 2017 21:26:26 +0200 Subject: [PATCH] Update flower help --- mods/HELP/mcl_doc/init.lua | 9 +++++++++ mods/ITEMS/mcl_flowers/init.lua | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mods/HELP/mcl_doc/init.lua b/mods/HELP/mcl_doc/init.lua index d9326102c..bf32ad849 100644 --- a/mods/HELP/mcl_doc/init.lua +++ b/mods/HELP/mcl_doc/init.lua @@ -46,6 +46,15 @@ doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) return datastring end) +-- flower +doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) + local datastring = "" + if def.groups.flower == 1 then + return "This is a flower which can grow on dirt, grass blocks and podzol. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher." + end + return "" +end) + -- flammable doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) if def.groups.flammable then diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index 776fe5d1f..1d303683e 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -5,6 +5,7 @@ flower_tmp={} -- Simple flower template local smallflowerlongdesc = "This is a small flower. Small flowers are mainly used for dye production and can also be potted." +local flowerusagehelp = "It can only be placed on a block on which it would also survive." -- on_place function for flowers local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos, node) @@ -29,6 +30,7 @@ local function add_simple_flower(name, desc, image, simple_selection_box) minetest.register_node("mcl_flowers:"..name, { description = desc, _doc_items_longdesc = smallflowerlongdesc, + _doc_items_usagehelp = flowerusagehelp, drawtype = "plantlike", tiles = { image..".png" }, inventory_image = image..".png", @@ -141,16 +143,18 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im if not inv_img then inv_img = top_img end - local flowergroup + local flowergroup, usagehelp if is_flower == nil then is_flower = true end if is_flower then flowergroup = 1 + usagehelp = flowerusagehelp end minetest.register_node("mcl_flowers:"..name, { description = desc, _doc_items_longdesc = longdesc, + _doc_items_usagehelp = usagehelp, drawtype = "plantlike", tiles = { bottom_img }, inventory_image = inv_img,