Extra Alchemy

Extra Alchemy

13M Downloads

[Crash] - Seems crashing with EMI when typing the letter "n"

xR4YM0ND opened this issue ยท 2 comments

commented

To Reproduce
Steps to reproduce the crash:

  1. Open Inventory
  2. below centered type something that contains the letter "n"
  3. The Game crashes / i think server side / Back to Main Menu

Gist Github links

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
commented

Does this happen if C2ME is not installed?

commented

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.