kennethsible / elytrapitch

Elytra Pitch (Fabric Mod)
https://modrinth.com/project/elytrapitch
MIT License
1 stars 0 forks source link

Crashes with Origins mod winged origin #6

Closed Traehgniw closed 1 month ago

Traehgniw commented 1 month ago

I had Trinkets installed so it wasn't the Trinkets-missing crash.

https://mclo.gs/MzvlYKh

I started the game with a flighted Origin, went to fly, and my game immediately froze completely.

kennethsible commented 1 month ago

In your crash log, I see there's an error on Line 251, which is where the elytra icon is drawn on the screen

https://github.com/kennethsible/elytrapitch/blob/1b2e88a09b744227df86e7d26a588a7998f3fc53/src/main/java/fatalflare/elytrapitch/ElytraPitch.java#L251

Can you go the ElytraPitch settings and disable "Show Icon" and see if the issue still happens? In the meantime, I'll read through the crash log more carefully and see if I can figure out the problem. Is this the conflicting mod: Origins?

Traehgniw commented 1 month ago

Yes, that's the conflicting mod! I have a datapack that adds an additional Origin, Snatcher. I have so far not tested with the default flighted origin Elytrian.

kennethsible commented 1 month ago
java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1799.method_7960()" because "$$2" is null

I think I see what happened. I tried searching for the Snatcher datapack, but I wasn't able to find it, so you'll have to confirm if my suspicion is correct. Does Origins + Snatcher add an elytra ability without an actual elytra equipped? Like, for example, the player just has the ability to fly from the beginning of the game? I am seeing a null pointer exception when trying to draw the elytra icon, which is grabbed from the icon of the equipped elytra, not just a picture file. If you aren't wearing an elytra, the mod will just crash. Let me know if my suspicion is correct and whether you still crash with the icon disabled. I can probably just disable the icon by default and add a warning about this as a tooltip in the setting menu.

Traehgniw commented 1 month ago

The up-to-date version of the Snatcher datapack is currently in testing and not publicly available, but yeah, no actual equipped elytra and with the icon not enabled there is no crash. It's the same for the Elytrian origin but that one doesn't have a default custom appearance for the wings/pseudo-elytra.

kennethsible commented 1 month ago

In that case, I'll add a safety check to prevent the game from crashing if the player isn't wearing an elytra. I'll also either just turn off the icon by default or ignore the icon setting if an elytra isn't equipped (maybe both).

kennethsible commented 1 month ago

I pushed a commit that fixes the crash without Trinkets (e83f27a). You'll see these changes in the next release (v1.4.2).