diff options
author | Spottedleaf <[email protected]> | 2020-06-20 14:59:49 -0400 |
---|---|---|
committer | Aikar <[email protected]> | 2020-06-20 14:59:49 -0400 |
commit | 1cf1ebdc5d9b56c3dac1812e10007da590272e7a (patch) | |
tree | ea56e4f4c0cd95ee84f29e8b1eee0a17ded746e0 | |
parent | 8f28f22ccfc19e064f849b9e391b266720447a5d (diff) | |
download | Paper-1cf1ebdc5d9b56c3dac1812e10007da590272e7a.tar.gz Paper-1cf1ebdc5d9b56c3dac1812e10007da590272e7a.zip |
Prevent position desync in teleporting during movement
Caused the server to revert to the player's overworld coordinates
after teleporting into the end.
Sidenote: The underlying issue is that the move call can teleport
entities and do other things like kill the entity. In the future,
to fix all exploits derieved from this usually unexpected
behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
-rw-r--r-- | Spigot-Server-Patches/0544-Prevent-position-desync-in-playerconnection-causing-.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0544-Prevent-position-desync-in-playerconnection-causing-.patch b/Spigot-Server-Patches/0544-Prevent-position-desync-in-playerconnection-causing-.patch new file mode 100644 index 0000000000..76b429cda6 --- /dev/null +++ b/Spigot-Server-Patches/0544-Prevent-position-desync-in-playerconnection-causing-.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf <[email protected]> +Date: Fri, 12 Jun 2020 16:51:39 -0700 +Subject: [PATCH] Prevent position desync in playerconnection causing tp + exploit + +Caused the server to revert to the player's overworld coordinates +after teleporting into the end. + +Sidenote: The underlying issue is that the move call can teleport +entities and do other things like kill the entity. In the future, +to fix all exploits derieved from this usually unexpected +behaviour, we need to move all of this dangerous logic outside +of the move call and into an appropriate place in the tick method. + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 7123e197c7ed01afd4fbf7aa0760611373039a13..3e5dea60fd043010506436e700601c0e8ffd8f17 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -1080,6 +1080,11 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9)); ++ // Paper start - prevent position desync ++ if (this.teleportPos != null) { ++ return; // ... thanks Mojang for letting move calls teleport across dimensions. ++ } ++ // Paper end - prevent position desync + this.player.onGround = packetplayinflying.b(); + double d12 = d8; + |