diff --git a/src/main/java/com/extendedclip/deluxemenus/action/ClickActionTask.java b/src/main/java/com/extendedclip/deluxemenus/action/ClickActionTask.java index 2fa55ec..14ebe62 100644 --- a/src/main/java/com/extendedclip/deluxemenus/action/ClickActionTask.java +++ b/src/main/java/com/extendedclip/deluxemenus/action/ClickActionTask.java @@ -10,7 +10,6 @@ import com.extendedclip.deluxemenus.utils.VersionHelper; import net.kyori.adventure.text.minimessage.MiniMessage; import org.bukkit.Bukkit; -import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.scheduler.BukkitRunnable; @@ -354,32 +353,16 @@ public void run() { case BROADCAST_SOUND: case BROADCAST_WORLD_SOUND: case PLAY_SOUND: - final Sound sound; + String sound; float volume = 1; float pitch = 1; if (!executable.contains(" ")) { - try { - sound = Sound.valueOf(executable.toUpperCase()); - } catch (final IllegalArgumentException exception) { - DeluxeMenus.printStacktrace( - "Sound name given for sound action: " + executable + ", is not a valid sound!", - exception - ); - break; - } + sound = executable; } else { String[] parts = executable.split(" ", 3); - try { - sound = Sound.valueOf(parts[0].toUpperCase()); - } catch (final IllegalArgumentException exception) { - DeluxeMenus.printStacktrace( - "Sound name given for sound action: " + parts[0] + ", is not a valid sound!", - exception - ); - break; - } + sound = parts[0]; if (parts.length == 3) { try { @@ -415,6 +398,8 @@ public void run() { } } + sound = sound.toLowerCase().replace("_", "."); + switch (actionType) { case BROADCAST_SOUND: for (final Player broadcastTarget : Bukkit.getOnlinePlayers()) {