j-tai / TieFix

A Fabric mod that fixes some annoying Minecraft bugs
GNU Lesser General Public License v3.0
17 stars 2 forks source link

Crashes when entering boats #10

Closed Vitamoon closed 2 years ago

Vitamoon commented 2 years ago

Hey there, tested each one of my mods and isolated it to TieFix.

Here's my Crashy report: https://crashy.net/5Bn3lIRBhKISPdZE2RtA

j-tai commented 2 years ago

I can’t reproduce this, so this is likely an incompatibility with another mod.

Does the crash still occur if you disable “Fix actionbar text missing shadow” in the TieFix settings?

Vitamoon commented 2 years ago

Yes. Tested with all features disabled and still crashes.

j-tai commented 2 years ago

Do you mind bisecting your mods to see which one is causing the conflict?

Disable half of your mods and see if it still crashes. If it does, then the conflict is in the enabled half; if not then it's in the disabled half. Repeat until you've isolated which mod causes the conflict with TieFix.

Also, please post the log file (.minecraft/logs/latest.log) leading up to the crash.

Vitamoon commented 2 years ago

Looks like the issue was KronHUD (v2.0.3 if it matters). Here is the crash report: crash-2022-05-15_11.18.35-client.txt

j-tai commented 2 years ago

This crash occurs because, when you enter a boat, an actionbar text "Press Left Shift to dismount" is displayed. TieFix modifies this message to add a shadow to it, which fixes MC-145929. It seems like KronHUD tries to cancel this rendering completely, opting to do the rendering by itself.

The way KronHUD cancels the rendering is strange: it replaces the text with an empty string, so an empty text gets rendered instead. It gets the 2nd argument to the draw call, expecting it to be a Text, and replaces it. However, because TieFix uses a Redirect injection on that call, it is replaced by a proxy which takes different parameters -- the first param is now the object that draw was called on. This means that the Text gets moved to the 3rd argument, and the 2nd argument is now a MatrixStack which cannot be cast to Text, causing the error.

I think the ideal way to fix this would be to make KronHUD cancel the draw in a different way. I'll see if I can send a PR to KronHUD.

j-tai commented 2 years ago

Closing this since the PR above has been merged. The next version of KronHUD will contain the fix.