aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0439-Prevent-position-desync-in-playerconnection-causing-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0439-Prevent-position-desync-in-playerconnection-causing-.patch')
-rw-r--r--patches/server/0439-Prevent-position-desync-in-playerconnection-causing-.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/patches/server/0439-Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/0439-Prevent-position-desync-in-playerconnection-causing-.patch
new file mode 100644
index 0000000000..e5cf4e564f
--- /dev/null
+++ b/patches/server/0439-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/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+index 7c7cd7e9ee014f5b822a94d394ab1978dcff7beb..24c605ab53c45daa8f6e2b4e8004e056b38d75a5 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -1338,6 +1338,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+
+ this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
+ this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
++ // Paper start - prevent position desync
++ if (this.awaitingPositionFromClient != null) {
++ return; // ... thanks Mojang for letting move calls teleport across dimensions.
++ }
++ // Paper end - prevent position desync
+ double d12 = d8;
+
+ d7 = d0 - this.player.getX();