Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thaumcraft 4 Particle Client Crash on Changing Worlds #484

Open
1 task done
DrParadox7 opened this issue Jan 29, 2025 · 4 comments
Open
1 task done

Thaumcraft 4 Particle Client Crash on Changing Worlds #484

DrParadox7 opened this issue Jan 29, 2025 · 4 comments

Comments

@DrParadox7
Copy link
Contributor

DrParadox7 commented Jan 29, 2025

Your GTNH Discord Username

TechnoParadox

Mod Version

Thaumcraft 4.2.3.5

Bug Report

I have found a crash with TC4 Particles causing crashes when switching worlds.

Specifically, the issue occurs when switching from a world where a TC4 particle exists to then moving to any other world that doesn't have it (most noticeable when switching from MP to SP). Issue gets fixed upon reloading the instance.

At first I thought it was a COFH Core issue, but looking at the collection of crash reports sent to me on this issue, it could only ever occur with TC4 particles and looking at the code, it strikes me more as a problem on TC side.

TC Particles from a previous world seem to stay in memory in the client and will attempt to update themselves on load in a world they do not belong in causing a crash when spatial related methods are called (or at least that's what I am assuming that's happening).

I'll post the TC Method in question:

thaumcraft.client.fx.ParticleEngine.updateParticles
Line 150: entityfx.onUpdate();

I need advice on how this should be patched effectively.
Tagging @Glease for his intimate understanding of TC4 source-code.

Java Version

Java 8

Mod List or GTNH Pack Version

Some crash report on the issue

crash-2025-01-29_16.10.21-client.txt

crash-2024-07-29_22.56.48-client.txt

Final Checklist

  • I have searched the issues and haven't found a similar issue.
@ailanlana
Copy link

Is it triggered when switching servers on the Velocity network?

@Glease
Copy link
Contributor

Glease commented Feb 24, 2025

Did you quit and reopen save file or switch between worlds in a back and forth fasion? Like, go through nether portals repeatedly. If yes, then I can see how it's ticking the wrong world. Just rewrite the worldObj to make every particle having a reference to correct World object on world load event should do the trick. Alternatively, rewrite the TC4 particle engine to not keep particle of every worlds at all could be even better (as now it'd create some world leak, if user never go back to prior worlds)

Nevertheless, it still seems rather strange as how a CCE can be thrown like that. The old World object is still a valid World with everything inside in tact. Unless some mod blocks require global data structures (like how GT multiblock oil pump would ask a global data store for how much oil is left in current chunk), simply ticking a particle should not just magically have everything blown up.

@Glease
Copy link
Contributor

Glease commented Feb 24, 2025

I'll go make a patch implementing the first route. it might cause a few weird particles to show up if it's MP and someone else has modified the setup while current user is away e.g. killing dragon in the end, but otherwise should not have any other impact

I'm still very skeptical at how this can end up in a CCE. I have great doubts as whether TC4 code is indeed the true culprit..

@Glease
Copy link
Contributor

Glease commented Feb 24, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants