forked from Mineclonia/Mineclonia
Make jukebox accept and play old music records
With the introduction of the mcl_jukebox API, all music record items were given new names. Old music record items were aliased, but never worked with the jukebox. Apparently no one tested existing records. By explicitly looking up the item name in minetest.registered_aliases, the jukebox accepts old records, plays them, and gives out new records.
This commit is contained in:
parent
811b6d7058
commit
5f0710a486
|
@ -92,7 +92,9 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
local play_record = function(pos, itemstack, player)
|
local play_record = function(pos, itemstack, player)
|
||||||
local name = itemstack:get_name()
|
local item_name = itemstack:get_name()
|
||||||
|
-- ensure the jukebox uses the new record names for old records
|
||||||
|
local name = minetest.registered_aliases[item_name] or item_name
|
||||||
if mcl_jukebox.registered_records[name] then
|
if mcl_jukebox.registered_records[name] then
|
||||||
local cname = player:get_player_name()
|
local cname = player:get_player_name()
|
||||||
if active_tracks[cname] ~= nil then
|
if active_tracks[cname] ~= nil then
|
||||||
|
|
Loading…
Reference in New Issue