-
Bug
-
Resolution: Fixed
-
Minecraft 1.4.5, Snapshot 12w50b, Snapshot 13w10a, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w17a, Snapshot 13w18b, Snapshot 13w18c, Snapshot 13w19a, Snapshot 13w21b, Snapshot 13w26a, Minecraft 1.6.2, Minecraft 14w33c, Minecraft 14w34b, Minecraft 1.8-pre1, Minecraft 1.8-pre3, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1-pre4, Minecraft 1.8.1, Minecraft 1.8.8, Minecraft 15w35e, Minecraft 1.8.9, Minecraft 16w02a, Minecraft 16w05a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.4, Minecraft 1.10 Pre-Release 1, Minecraft 1.10, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w44a, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w48a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w06a, Minecraft 18w10d, Minecraft 18w11a, Minecraft 18w14b, Minecraft 18w15a, Minecraft 18w16a, Minecraft 18w19b, Minecraft 18w20a, Minecraft 18w20c, Minecraft 18w21a, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13-pre8, Minecraft 1.13-pre9, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2
-
Confirmed
The bug
Currently, when teleporting a player (either relatively or absolutely) the motion of the teleport is visible sometimes, but not always. This behaviour is inconsistent even at 60fps.
How to reproduce
- Make two identical buildings 16 blocks apart from each other on the worlds X axis
- Keep executing the following two commands
/tp ~16 ~ ~
/tp ~-16 ~ ~
→ Note the occasional flash in between the teleports
Results
When a teleportation occurs, a flash is sometimes seen. Sometimes blocks even disappear until you move your mouse.
This flash is caused by extra frames generated during the teleportation. Causing an image to be rendered from the position in between the start position and the destination. The disappearing blocks is a different issue that deserves its own ticket.
Expected
To either not see a flash at all, or see it all the time (at 60fps).
Possible fix
It appears that this happens because only one of the two previous position fields is updated when teleporting. Specifically, setPositionAndRotation updates prevPosX/Y/Z, but leaves lastTickX/Y/Z alone. Both of these fields are used to interpolate position (each in different contexts), and only using one causes this bug. (Side note: I'm not entirely sure why there are two fields that have more or less the same purpose - perhaps they can be merged).
This is my (pokechu22) fix (in NetHandlerPlayClient.handlePlayerPosLook):
EntityPlayer player = this.gameController.player; double x = packetIn.getX(); double y = packetIn.getY(); double z = packetIn.getZ(); float yaw = packetIn.getYaw(); float pitch = packetIn.getPitch(); if (packetIn.getFlags().contains(SPacketPlayerPosLook.EnumFlags.X)) { player.lastTickPosX += x; player.chasingPosX += x; player.prevChasingPosX += x; x += player.posX; } else { player.lastTickPosX = x; player.chasingPosX = x; player.prevChasingPosX = x; player.motionX = 0.0D; } if (packetIn.getFlags().contains(SPacketPlayerPosLook.EnumFlags.Y)) { player.lastTickPosY += y; player.chasingPosY += y; player.prevChasingPosY += y; y += player.posY; } else { player.lastTickPosY = y; player.chasingPosY = y; player.prevChasingPosY = y; player.motionY = 0.0D; } if (packetIn.getFlags().contains(SPacketPlayerPosLook.EnumFlags.Z)) { player.lastTickPosZ += z; player.chasingPosZ += z; player.prevChasingPosZ += z; z += player.posZ; } else { player.lastTickPosZ = z; player.chasingPosZ = z; player.prevChasingPosZ = z; player.motionZ = 0.0D; }
I update lastTickPosX/Y/Z by the delta if it is a relative teleport, and set it directly if it is an absolute teleport. Changing it by the delta is important - if we just set it to the new position, then there actually is a (subtle) pause as the camera stays in the new position for the entire tick rather than moving between the offset old position and the new position.
I also update prevChasingPos/chasingPosX/Y/Z, which are used to render capes. This keeps capes from spazing out when teleporting (but isn't too important to the core problem).
I don't touch prevPosX/Y/Z at all in this code, simply because any changes made would be overwritten by the call to setPositionAndRotation. It may be better to also adjust prevPosX/Y/Z by the delta, but I couldn't detect a significant difference and that would require tweaking setPositionAndRotation.
(note that MC-120545 needs to also be fixed for seamless teleporting)
- is duplicated by
-
MC-9136 Remove travel time for teleporting
- Resolved
-
MC-13294 /
- Resolved
-
MC-18943 Client getting extra frames while traveling from one location to another through a teleport command.
- Resolved
-
MC-28476 Teleporting showing what's in between positions for a moment
- Resolved
-
MC-66841 Teleportation is not seamless anymore
- Resolved
-
MC-67740 Relative teleporting bug
- Resolved
-
MC-68222 teleport lagg
- Resolved
-
MC-69699 Glitchy relative teleporting
- Resolved
-
MC-70073 Seamless Teleportation is broken
- Resolved
-
MC-72135 /tp will show 1-3 frames of the middle between where you were and where you are teleported to
- Resolved
-
MC-87075 Relative teleportation jitters and flickers
- Resolved
-
MC-95542 Smooth teleporting no longer works
- Resolved
-
MC-96297 Teleport
- Resolved
- relates to
-
MC-14861 teleporting using commands resets the velocity
- Resolved
-
MC-94168 Items fall into opening shulker
- Open
-
MC-94738 Entity movement happens independently from executing commands
- Resolved
-
MC-122118 /tp @s ~ ~ ~ acts like an absolute teleport, killing all momentum
- Resolved
- testing discovered
-
MC-120545 Teleportation wraps rotation angles causing first-person hand to rotate incorrectly
- Open