From acd58f6fe5ff79af5e4fbbc221805309f1f66ec7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 12 May 2018 23:57:49 +0200 Subject: [PATCH] Fix jukeboxes destroying music disc metadata --- mods/ITEMS/mcl_jukebox/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_jukebox/init.lua b/mods/ITEMS/mcl_jukebox/init.lua index 5182c70e88..6ae5dbdfd2 100644 --- a/mods/ITEMS/mcl_jukebox/init.lua +++ b/mods/ITEMS/mcl_jukebox/init.lua @@ -150,7 +150,7 @@ minetest.register_node("mcl_jukebox:jukebox", { local ly = pos.y+1 local lz = pos.z local record = inv:get_stack("main", 1) - local dropped_item = minetest.add_item({x=lx, y=ly, z=lz}, record:get_name()) + local dropped_item = minetest.add_item({x=lx, y=ly, z=lz}, record) -- Rotate record to match with “slot” texture dropped_item:set_yaw(math.pi/2) inv:set_stack("main", 1, "") @@ -164,7 +164,9 @@ minetest.register_node("mcl_jukebox:jukebox", { -- Jukebox is empty: Play track if player holds music record local playing = play_record(pos, itemstack, clicker) if playing then - inv:set_stack("main", 1, itemstack:get_name()) + local put_itemstack = ItemStack(itemstack) + put_itemstack:set_count(1) + inv:set_stack("main", 1, put_itemstack) itemstack:take_item() end end