MusicPlayer definitely is pretty finicky!
From my earlier post in this thread, I think this issue has to do with probably a mod playing and pausing a bunch of tracks, and the game runs out of buffers to play a new track and hangs infinitely waiting for one to become available. I've bumped up the buffer pool size to 10 (from 5) so that may help unless some bit of code just keeps opening and pausing a bunch of music until it runs out of buffers. I'm not sure how this would be related to Java 23, though, that's odd.
The freeze can happen from entities that just let the game handle the music loading, i.e music key in a .faction file and it just loading the music relevant to that entities faction, or from an overwriten musicsetkey on the entities memory, so i dont think its because of how a certain mod handles the music playing.
For the transition in my bosses Phase2, the moment the transition starts i pause the music that Phase1 started:
Global.getSoundPlayer().pauseCustomMusic()
A few seconds later i call a resume and tell it to play the phase 2 theme.
Global.getSoundPlayer().resumeCustomMusic()
Global.getSoundPlayer().playCustomMusic(1, 1, "rat_abyss_genesis2", true)
Neither of the code can ever be called twice. I do call "resumeCustomMusic()" before starting the new track as it otherwise appeared to crash, so i asume that is the correct useage.
But anyways it freezes either when called like this, or from the standard way entities do music.
And yeah, it being a Java23 (or the kit) issue is pretty weird, but i am pretty sure that it is part of the issue, since how i mentioned the issue hasnt exited before there was a in-dev version of the conversion kit & somebody used it, and only really became more common after people started using the kit, with everybody reporting it so far mentioning that they use Java23.