aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch
diff options
context:
space:
mode:
authorAikar <[email protected]>2020-08-06 22:49:50 -0400
committerDaniel Ennis <[email protected]>2020-08-06 22:55:24 -0400
commitadadf16548ad220bf178596f8b9bc0a0ffeaef19 (patch)
tree35cb9d5d115d5c46287914614d5512ed0864aca7 /Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch
parent6f66fa57143ad9a48a8f812cf13acf62393aa56c (diff)
downloadPaper-adadf16548ad220bf178596f8b9bc0a0ffeaef19.tar.gz
Paper-adadf16548ad220bf178596f8b9bc0a0ffeaef19.zip
Drop syncPosition on teleportation patch
I'm not sure it was really helping, and now suspecting it might be causing issues Movement sucks
Diffstat (limited to 'Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch')
-rw-r--r--Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch b/Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch
new file mode 100644
index 0000000000..a9a8693e35
--- /dev/null
+++ b/Spigot-Server-Patches/0511-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 cace81e707245ba35be3c6d536b56618045e4c20..4050fa4b8ed060599fb3c14622737117fb2602df 100644
+--- a/src/main/java/net/minecraft/server/PlayerConnection.java
++++ b/src/main/java/net/minecraft/server/PlayerConnection.java
+@@ -1097,6 +1097,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
+
+ this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
+ this.player.c(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move
++ // Paper start - prevent position desync
++ if (this.teleportPos != null) {
++ return; // ... thanks Mojang for letting move calls teleport across dimensions.
++ }
++ // Paper end - prevent position desync
+ double d12 = d8;
+
+ d7 = d4 - this.player.locX();