diff --git a/mods/jukebox/init.lua b/mods/jukebox/init.lua index 6f2ce9b1..668bad6a 100755 --- a/mods/jukebox/init.lua +++ b/mods/jukebox/init.lua @@ -1,5 +1,6 @@ jukebox = {} jukebox.tracks = {} +jukebox.nbtracks = 0 jukebox.particles = {} function make_particles(pos) @@ -140,7 +141,7 @@ local function register_disc(trackname, trackdesc, craftitem) trackdesc = trackdesc or "???" craftitem = craftitem or "group:wood" - local id = #jukebox.tracks + local id = jukebox.nbtracks minetest.register_craftitem("jukebox:disc_" .. id, { description = "Music Disc : " .. trackdesc, @@ -163,6 +164,8 @@ local function register_disc(trackname, trackdesc, craftitem) minetest.log("action", "[jukebox] Registrered disc " .. trackdesc .. ", id = " .. id .. " for file " .. trackname) + + jukebox.nbtracks = jukebox.nbtracks + 1 end register_disc("jukebox_event", "Event song", "default:stone") diff --git a/mods/jukebox/sounds/jukebox_song.1.ogg b/mods/jukebox/sounds/jukebox_song.1.ogg old mode 100644 new mode 100755