KosmoMoustache / MusicNotification

https://modrinth.com/mod/music-notification
GNU Lesser General Public License v3.0
8 stars 4 forks source link

Crash if music disc description doesn't contain a hyphen #49

Closed TunYuntuwuQWQ closed 3 months ago

TunYuntuwuQWQ commented 3 months ago

It seems like there's an error occurring when using this mod alongside the AddurDisc (version 1.2) mod. The error message suggests that when trying to play music discs added by the AddurDisc mod, an issue arises, and the discs fail to play correctly.

[00:12:21] [Render thread/ERROR]: Error executing task on Client net.minecraft.class_148: Playing level event at net.minecraft.class_638.method_8444(class_638.java:594) ~[client-intermediary.jar:?] at net.minecraft.class_1936.method_20290(class_1936.java:102) ~[client-intermediary.jar:?] at net.minecraft.class_634.method_11098(class_634.java:1397) ~[client-intermediary.jar:?] at net.minecraft.class_2673.method_11535(class_2673.java:38) ~[client-intermediary.jar:?] at net.minecraft.class_2673.method_11054(class_2673.java:8) ~[client-intermediary.jar:?] at net.minecraft.class_2600.method_11072(class_2600.java:22) ~[client-intermediary.jar:?] at net.minecraft.class_1255.method_18859(class_1255.java:156) ~[client-intermediary.jar:?] at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[client-intermediary.jar:?] at net.minecraft.class_1255.method_16075(class_1255.java:130) ~[client-intermediary.jar:?] at net.minecraft.class_1255.method_5383(class_1255.java:115) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1523(class_310.java:1175) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1514(class_310.java:802) ~[client-intermediary.jar:?] at net.minecraft.client.main.Main.main(Main.java:250) ~[1.20.1.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.11.jar:?] Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 at net.kosmo.music.ClientMusic.onDiscPlay(ClientMusic.java:157) ~[musicnotification-2.0.1+1.20.1.jar:?] at net.minecraft.class_761.handler$zlm000$musicnotification$onPlaySong(class_761.java:4440) ~[client-intermediary.jar:?] at net.minecraft.class_761.method_8562(class_761.java) ~[client-intermediary.jar:?] at net.minecraft.class_761.method_8567(class_761.java:3110) ~[client-intermediary.jar:?] at net.minecraft.class_638.method_8444(class_638.java:584) ~[client-intermediary.jar:?] ... 15 more

I have already modified the item description format in version 1.3 to address this issue, but I think some checks need to be performed here.

Pull requests #50