aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0361-Prevent-position-desync-causing-tp-exploit.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-12-05 11:18:29 +0100
committerNassim Jahnke <[email protected]>2024-12-05 12:20:56 +0100
commite4e24f3335609b38f460ced71d18babcf11bf9cb (patch)
tree51880d664b3444ce26d6f8cdeb3b8219e5616fca /patches/server/0361-Prevent-position-desync-causing-tp-exploit.patch
parentc54c062e6ff742445bf7749c84106ca67090172d (diff)
downloadPaper-e4e24f3335609b38f460ced71d18babcf11bf9cb.tar.gz
Paper-e4e24f3335609b38f460ced71d18babcf11bf9cb.zip
Move around patches again
Diffstat (limited to 'patches/server/0361-Prevent-position-desync-causing-tp-exploit.patch')
-rw-r--r--patches/server/0361-Prevent-position-desync-causing-tp-exploit.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/server/0361-Prevent-position-desync-causing-tp-exploit.patch b/patches/server/0361-Prevent-position-desync-causing-tp-exploit.patch
new file mode 100644
index 0000000000..f73360e724
--- /dev/null
+++ b/patches/server/0361-Prevent-position-desync-causing-tp-exploit.patch
@@ -0,0 +1,30 @@
+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 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 517c215d47737c551125dec785de2896560f4cb0..9229caf16997e8bd6da6fae1532372827ec80291 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -1413,6 +1413,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+
+ this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
+ 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 d11 = d7;
+
+ d6 = d0 - this.player.getX();