From 134005180cc9bbc91a39919b6aa1fe4d35c8357f Mon Sep 17 00:00:00 2001 From: AFCMS Date: Thu, 11 Mar 2021 17:49:16 +0000 Subject: [PATCH] add global table of registered flowers (to be used with mcl_flowerpots and other mods) --- mods/ITEMS/mcl_flowers/init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index ff8c759818..8b1a605d3d 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -3,6 +3,7 @@ local mod_screwdriver = minetest.get_modpath("screwdriver") ~= nil local modpath = minetest.get_modpath("mcl_flowers") mcl_flowers = {} +mcl_flowers.registered_simple_flowers = {} -- Simple flower template local smallflowerlongdesc = S("This is a small flower. Small flowers are mainly used for dye production and can also be potted.") local plant_usage_help = S("It can only be placed on a block on which it would also survive.") @@ -53,7 +54,13 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos, end) function mcl_flowers.register_simple_flower(name, desc, image, simple_selection_box) - minetest.register_node("mcl_flowers:"..name, { + local newname = "mcl_flowers:"..name + mcl_flowers.registered_simple_flowers[newname] = { + desc=desc + image=image + simple_selection_box=simple_selection_box + } + minetest.register_node(newname, { description = desc, _doc_items_longdesc = smallflowerlongdesc, _doc_items_usagehelp = plant_usage_help,