From c63fa1b2d1c2c3b8704337f7908e4dd18bbc1733 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 21 Mar 2021 21:52:02 -0400 Subject: Fix custom music file on non-windows operating systems --- README.md | 10 ++-------- src/main/java/me/Danker/features/CustomMusic.java | 5 +++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6f484d7..a2f0227 100644 --- a/README.md +++ b/README.md @@ -93,14 +93,8 @@ Discord Server: https://discord.gg/QsEkNQS - Start/Stop Skill Tracker - Numpad 5 by default. ## Custom Music -- Supported audio formats: - - .wav - - .mid - - .aiff - - .au - - .rmf -- For the following custom music, place a supported music file with the given name in the `.minecraft/config/dsmmusic` folder. - - Dungeon boss music: `dungeonboss` +- To use custom music, place a music file with the given name in the `.minecraft/config/dsmmusic` folder and enable the custom song in /dsm. + - Dungeon boss music: `dungeonboss.wav` ### Notes - Slayer tracker for token drops and 20% chance drops uses a 12x12x12 bounding box centered on the player to detect the drops. If you are out of the range of the item drop, it will not count on the tracker. diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index d2d6b6f..3c411d8 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -85,13 +85,14 @@ public class CustomMusic { public static void init(String configDirectory) throws IOException, LineUnavailableException, UnsupportedAudioFileException { if (configDirectory == null) return; - File directory = new File(configDirectory + "\\dsmmusic"); + File directory = new File(configDirectory + "/dsmmusic"); if (!directory.exists()) directory.mkdir(); reset(); dungeonboss = AudioSystem.getClip(); - File dungeonBossFile = new File(configDirectory + "\\dsmmusic\\dungeonboss.wav"); + File dungeonBossFile = new File(configDirectory + "/dsmmusic/dungeonboss.wav"); + System.out.println("dungeonboss.wav exists?: " + dungeonBossFile.exists()); if (dungeonBossFile.exists()) { AudioInputStream ais = AudioSystem.getAudioInputStream(dungeonBossFile); dungeonboss.open(ais); -- cgit