[Crash] - Seems crashing with EMI when typing the letter "n"
xR4YM0ND opened this issue ยท 2 comments
To Reproduce
Steps to reproduce the crash:
- Open Inventory
- below centered type something that contains the letter "n"
- The Game crashes / i think server side / Back to Main Menu
Gist Github links
- Crash Log: No Crash Report created
- Latest Log: https://gist.github.com/SpigotDE/22caf58a3aab7943465cba80b5d96ba9
- Extra Alchemy Config: https://gist.github.com/SpigotDE/f5520c72a3d69d33c2e3877f209891b8
Environment (please complete the following information):
- Mod Version: 1.8.3
- MC Version: 1.19.2
- Fabric Version: 0.14.9
- Fabric API version: 0.60.0
- System: Windows 10
- Installation type: Singleplayer / should crash on Multiplayer too
This is caused by C2ME changing how randomization works. The networking thread tries to play a sound, where some randomization is done, while another thread (looks to be the rendering thread) owns the randomizer.
A fix for this was to run the playSound function on the render thread by doing the following:
ClientPlayNetworking.registerGlobalReceiver(S2C_Channels.PLAY_CLICK_SOUND, (client, handler, buf,responseSender) -> {
// Fix C2ME crash by wrapping in client.execute
client.execute(() -> {
client.player.playSound(SoundEvents.UI_BUTTON_CLICK, SoundCategory.MASTER, 1, 1);
});
});
Although I'm not sure if such a fix would be backported to 1.19.2, as it seems this repo has already moved towards 1.19.3 without a branch for 1.19.2.
Edit: it seems that the newer version of this mod uses another method of playing sound by grabbing the sound manager. I'm not sure if this suffers from the same issue with C2ME, and cannot currently be tested as C2ME is not (yet) on 1.19.3.