Desync while sitting on seats with Immersive Portals
AnxiousPotato opened this issue · 9 comments
Versions of Minecraft, Fabric and Adorn
- Adorn: 1.4.1/1.4.2
- Minecraft: 1.14.4
- Fabric Loader: 0.6.2 build 166
- Fabric API: 0.3.2 build 226
Describe the bug
Sitting on chairs causes a delay and mouse bug with the x-axis (or something.. idk how to describe it better). I uploaded a video in youtube to demonstrate this issue.
https://www.youtube.com/watch?v=Vvhel9c7HX8
To Reproduce
Literally just sit in any chair.
Expected behavior
Instantly sitting in the chair with no problems. And possibly be on the right height level when you do sit in the chair.
Additional context (Optional)
I removed Extra Pieces, Sit (on stairs and slabs) mod, and the First Person mod. Results were still the same.
I have these mods:
Sorry, I had my Github notifications turned off so I didn't notice this. I can take a look at the bug in a few days.
Confirmed on 1.16.3.
As a friend of mine pointed out this might be worth looking into and cross-posting to Immersive Portals' issue tracker especially because there's some "jittering" going on which could be critical for people with photosensitive epilepsy.
edit: It appears an issue might have already been created for this: iPortalTeam/ImmersivePortalsMod#327
I re-examined this issue. I tried to test it in dev environment but failed because this mod uses kotlin.
If the chunk (0,0) is not loaded, then the player will flicker for about one second.
If the chunk (0,0) is loaded, then the player hand will not flicker and the player position will stay in (0,-0.35,0) for about one second.
So it's an entity position sync issue. The fake seat entity is spawned in (0,0,0) and then has position updated. But the position update packet is not being sent in time with IP present because IP changes entity sync mechanics.
The real reason that the position packet is not sent in time is still unclear. But I suggest that Adorn firstly create the seat entity, then change its position (updatePosition
instead of setPos
) and then spawn the entity (instead of spawning the entity in (0,0,0) and then change position). By doing that this issue will probably be fixed and this code
PlayerStream.watching(this).forEach {
ServerSidePacketRegistry.INSTANCE.sendToPlayer(it, EntityPositionS2CPacket(this))
}
probably can be removed.
@qouteall Thanks for the analysis. This should be fixed now, will reopen if it still happens though.
I'm not sure how to debug this, but I experience the X axis being locked and a desync when sitting on chairs also. Running 1.16.4 w/ only the latest Adorn 1.12, Fabric, Fabric Language Kotlin