From dc6058a6d606cc3079270978ee5db690c9b9f923 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 29 Jul 2017 15:25:49 +0200 Subject: [PATCH] Spawn item with metadata after digging banner --- mods/ITEMS/mcl_banners/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index 2042a008f9..61cf821f38 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -271,7 +271,13 @@ minetest.register_entity("mcl_banners:standing_banner", { pos.y = pos.y + 1 if not minetest.settings:get_bool("creative_mode") and self._base_color then - minetest.add_item(pos, "mcl_banners:banner_item_"..mcl_banners.colors[self._base_color][1]) + -- Spawn item + local banner = ItemStack("mcl_banners:banner_item_"..mcl_banners.colors[self._base_color][1]) + local meta = banner:get_meta() + meta:set_string("layers", minetest.serialize(self._layers)) + meta:set_string("description", mcl_banners.make_advanced_banner_description(banner:get_definition().description, self._layers)) + + minetest.add_item(pos, banner) end -- Destroy entity