alejandrocoria / MapFrontiers

Mod for Minecraft
https://alejandrocoria.games/projects/MapFrontiers/
MIT License
10 stars 5 forks source link

New versions crash on loading #48

Closed FLORIAN4600 closed 4 months ago

FLORIAN4600 commented 4 months ago

Before 2.6.0p2 and 2.6.0p3, MapFrontiers would occasionnaly crash on loading, usually the first time I launch an instance with it. But now, since 2.6.0p2, the mod is crashing nearly every times I launch the game (edit: it now only happens 1/2 of the time)

I use: 1.20.1 forge 47.2.21 (+Windows 11) I do use a heavily modded modpack (with Create mod and addons, ImmersiveEngineering and ImmersiveAirplanes), but the bug seems to come from only MapFrontiers.

The log: latest.log

And crash report: crash-2024-06-27_17.34.20-fml.txt

Sadly enough, I cannot seem to be able to reproduce it with less mods and it usually happens when I introduce new mods to my modpack (each time I add a new mod, it will crash 2-3 times before working again)

alejandrocoria commented 4 months ago

You seem to have a mix of fabric and forge mods. Do you use something to make that work? Because it is definitely not expected.

FLORIAN4600 commented 4 months ago

Yeah, I understand that it is confusing The mix of fabric & forge mods actually comes from ported mods (from fabric to forge) Embeddium, Embeddium++, Forgified Fabric Api and Krypton Reforged are probably the one loading a bunch of ported mods from fabric

mysticdrew commented 4 months ago

This seems like an issue with some mod you are adding. Can you reproduce with only journeymap and and map frontiers?

FLORIAN4600 commented 4 months ago

I have not yet managed to get this crash without any other mods than map frontiers & journeymap I did notice though that you were registering your packets twice for forge Once in the clientSetup (FMLClientSetupEvent) and Once in the commonSetup (FMLCommonSetupEvent)

If it is not this, then it seems that sometimes the event responsible for the setup is firing twice, thus making a second PacketHandler.init() call

And the presence of "PacketHandler init done" in the logs, some times before the crash is affirming that the function is actually called twice, with maybe either the Common and the Client setup event both firing, or one of the two firing twice

alejandrocoria commented 4 months ago

Please try this jar and tell me if it works: MapFrontiers-1.20.1-2.6.0p3-forge.zip

FLORIAN4600 commented 4 months ago

the jar did not worked latest.log crash-2024-06-29_20.47.03-fml.txt

(I actually forgot to remove a mixin trace mod, so the crash report might be a little confusing)

I'll try to reproduce the crash with only mapfrontiers on

mysticdrew commented 4 months ago

I'll try to reproduce the crash with only mapfrontiers on

you also need journeymap

This issue should not be happening, this is really quite strange. I make sure a packet can only be registered once per side with common-networking. I also added exception handling so that if it does try to register a 2nd time it shouldn't cause a crash.

Let's see if it is reproducible with just JM and map frontiers. If not, start adding mods back in until it starts blowing up so we can know what mod is causing the issue so we can resolve this.

alejandrocoria commented 4 months ago

Give this a try please: MapFrontiers-1.20.1-2.6.0p3-forge.zip

FLORIAN4600 commented 4 months ago

It seems to have fixed it ! I ran my game about 50 to 60 times, and it never crashed (it would usually crash once every 2 to 3 run)

I will, if I have some time for it tomorrow, try to mess a bit with adding and removing client mods, restarting my computer, and run it a couple more times

But as for now, the issues seems to have been completly fixed (I am curious now about what you did to fix it)

alejandrocoria commented 4 months ago

I removed the client-side register (I thought I already did it but I was misremembering). It shouldn't cause that problem because common-networking keeps track of the channels already registered. It's weird.

Thanks for your report and thanks @mysticdrew for the help.

I'll close this when I publish the new version.

alejandrocoria commented 4 months ago

Published!

Thanks again for your time!