2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
Date: Fri, 12 Jun 2020 16:51:39 -0700
|
2024-01-20 23:13:41 +01:00
|
|
|
Subject: [PATCH] Prevent position desync causing tp exploit
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
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
|
2024-04-28 03:00:01 +02:00
|
|
|
index b715e7b3230dba24d10230d5e4d8dd5589f93018..2e27141c6cc2dec758f294381da39a683c4e194d 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2024-04-25 23:21:18 +02:00
|
|
|
@@ -1355,6 +1355,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2023-06-08 01:20:26 +02:00
|
|
|
this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
|
2021-12-02 21:21:33 +01:00
|
|
|
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
|
2021-06-11 14:02:28 +02:00
|
|
|
+ // Paper start - prevent position desync
|
|
|
|
+ if (this.awaitingPositionFromClient != null) {
|
|
|
|
+ return; // ... thanks Mojang for letting move calls teleport across dimensions.
|
|
|
|
+ }
|
|
|
|
+ // Paper end - prevent position desync
|
2023-06-08 01:20:26 +02:00
|
|
|
double d11 = d7;
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2023-06-08 01:20:26 +02:00
|
|
|
d6 = d0 - this.player.getX();
|