From 45c830d18c558f62c34710200665537ad166b0e4 Mon Sep 17 00:00:00 2001 From: Apehum <36326454+Apehum@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:56:09 +0800 Subject: [PATCH] fix: play disc only if jukebox is empty --- changelog.md | 1 + .../kotlin/su/plo/voice/discs/event/JukeboxEventListener.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 66fcbe2..fcb210a 100644 --- a/changelog.md +++ b/changelog.md @@ -2,3 +2,4 @@ - DISABLE — Disables any lore manipulations on burn/erase. - REPLACE (default) — Replaces the whole lore with a string containing the song name on burn, and removes the lore completely on erase. - APPEND — Adds a new line to the end of the lore on burn, and removes the last line on erase. +- Fixed clicking with a custom disc into a stopped jukebox with a disc already inside would cause it to play track without actually inserting the disc. \ No newline at end of file diff --git a/core/src/main/kotlin/su/plo/voice/discs/event/JukeboxEventListener.kt b/core/src/main/kotlin/su/plo/voice/discs/event/JukeboxEventListener.kt index e8fac2f..937c0ec 100644 --- a/core/src/main/kotlin/su/plo/voice/discs/event/JukeboxEventListener.kt +++ b/core/src/main/kotlin/su/plo/voice/discs/event/JukeboxEventListener.kt @@ -81,7 +81,7 @@ class JukeboxEventListener : Listener, PluginKoinComponent { val jukebox = block.asJukebox() ?: return - if (jukebox.isPlaying) return + if (jukebox.record.type != Material.AIR) return val item = event.item?.takeIf { it.isCustomDisc() } ?: return