Mekanism

Mekanism

111M Downloads

Crashing related to the sound of Enrichment Chamber and various other machines

JazDog02 opened this issue ยท 9 comments

commented

Issue description

While trying to use the advanced enrichment factory my client will crash and bring me back to the launcher. According to the crash logs I think it's the sound that is causing my client to crash.

Steps to reproduce:

  1. Place items into the advanced enrichment factory
  2. Have the enrichment factory make noise indicating that it is working
  3. Keep crashing until the machine eventually stops making noise, alloying you to play the game again.

Version (make sure you are on the latest version before reporting):

Forge: 36.1.16
Mekanism: Mekanism-1.16.5-10.0.21.448
Other relevant version:

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

[gist

commented

xD ye your sounds probably didnt work as you intended them aswell, but at least its no longer crashing so less urgent

commented

I've added a nullcheck to performant now which solves the crash, though you may not want to send the event with a null sound manager when vanilla has it never null

commented

I can add a null check but out of curiosity what case can MC have tiles and such with there being no sound engine? Or is performant stopping the sound engine from being initialized in the first place in which case I would say that isn't a particularly safe thing to do without say just setting it to some dummy sound engine, given as you say vanilla has the sound manager as never being null.

commented

I think it might have to do with this other mod I have called "Extreme Sound Muffler" so I'm going to remove it from my modpack and see if that makes a difference...

Edit: Just checked and that isn't the issue...

commented

nah I just added a hook to the sound event which prevents too many same sounds :

 public static void onPlaySound(PlaySoundEvent event)
    {
        int similarcount = 0;
        for (final ISound sound : event.getManager().playingSoundsStopTime.keySet())
        {
            if (sound.getSoundLocation().equals(event.getSound().getSoundLocation()))
            {
                similarcount++;
                if (similarcount == 10)
                {
                    event.setResultSound(null);
                    break;
                }
            }
        }
    }

So not sure whats going on with the tile sounds

commented

Is this something to do with mekanism on it's own or do you think there's an issue with another mod I have installed?

commented

Hmm seems like this might have been introduced by MinecraftForge/MinecraftForge#6955 which made it so that the SoundSetupEvent isn't being fired anymore... Not quite sure what that is about, and no idea why it didn't break earlier.

commented

I guess theres just few accessing the manager in the event

commented

Ya no idea, though I will try to get a PR made to forge sometime this week that reinstates the SoundSetupEvent, so that our code that grabs what the sound engine should be actually works correctly...