mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Spawn item with metadata after digging banner
This commit is contained in:
parent
ea7c1e6446
commit
dc6058a6d6
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue