diff options
Diffstat (limited to 'src/main/java/me')
-rw-r--r-- | src/main/java/me/Danker/features/CustomMusic.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 1f609cc..5153f91 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -229,14 +229,23 @@ public class CustomMusic { public void start() throws UnsupportedAudioFileException, LineUnavailableException, IOException { - if (music == null) music = AudioSystem.getClip(); - if (!music.isRunning()) { - reset(); - shuffle(); - setVolume(volume); - cancelNotes = true; - music.setMicrosecondPosition(0); - music.start(); + try { + if (music == null) music = AudioSystem.getClip(); + if (!music.isRunning()) { + reset(); + shuffle(); + setVolume(volume); + cancelNotes = true; + music.setMicrosecondPosition(0); + music.start(); + } + } catch (UnsupportedAudioFileException ex) { + ex.printStackTrace(); + + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player != null) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Attempted to play non .wav file. Please use a .wav converter instead of renaming the file.")); + } } } |