quat1024 / AutoThirdPerson

"Tiny" Minecraft mod to put you in third person when you ride a minecart or whatever.
https://minecraft.curseforge.com/projects/auto-third-person
5 stars 3 forks source link

[Bug] Player remains in 3rd person if boat breaks #11

Closed teleheel closed 1 year ago

teleheel commented 1 year ago

With autoRestore = true, if the boat is broken while the player sits in it (e.g. due to fall damage, cactus, explosions, etc.), the player remains in 3rd person even after the boat is broken. One can change back to 1st person manually.

quat1024 commented 1 year ago

That's odd. I need to ask which version/loader, since the method of tracking whether you're riding a boat is different across the releases.

teleheel commented 1 year ago

Sure, I tested on 1.20.1 with Fabric Loader 0.14.22.

If Fabric API is a dependency, I used version 0.86.1+1.20.1.

quat1024 commented 1 year ago

Sorry for letting this sit for so long, been busy with Blanketcon and some sickness 😔

It looks like the problem was a stray isAlive check in EntityVehicle#equals:

https://github.com/quat1024/AutoThirdPerson/blob/4bb985eb2ac27ca15ab0c213e23fa1975c6b367d/Xplat-1.20.1/src/main/java/agency/highlysuspect/autothirdperson/TwentyZeroAutoThirdPerson.java#L140

The way the mod detects mounting/dismounting is kind of sloppy.

I think a far better approach would be to just get the "current" vehicle instead of trying to use mount/dismount events. For now, removing this check seems to fix it.